"Opening and creating websites on iis requires running visual studio under an administrator account" - visual-studio

I'm seeing this error in a pop-up window when attempting to run/debug my web project from Visual Studio
The following error occurred when trying to configure IIS Express. Opening and creating websites on iis requires running visual studio under an administrator account
This happened completely out of the blue. One second I was working as normal, regularly going in and out of debug in my browser, then this error pops up. It happens when attempting to run any web project, and it doesn't matter if it's in debug, release mode or what.
Stuff I've tried:
Run Visual Studio as Administrator
Uninstall/Reinstall IIS Express (via "Turn Windows Features On or Off" in Control Panel)
Update Visual Studio
Delete project's .vs folder
But still the error persists.
Is there anything else I can reinstall, update or otherwise check?
Thanks.

Solved it by going through a day of hell, and to be honest the 'solution' was very brute force...
TL;DR: Fully deleting and reinstalling Visual Studio seemed to do the trick.
Since the usual methods weren't working, I tried a full reinstall of Visual Studio. That didn't help. I then tried a System Restore. That made everything far worse, with my project showing about 500 error messages!
I then undid the System Restore, completely deleted all traces of Visual Studio from my computer, reinstalled everything, then tried VS2019 preview edition, tried 2017 edition again, uninstalled and reinstalled NetCore 2.0, 2.1, 2.2... all just to get around the minefield of error messages I'd created for myself.
In the end I just needed to do a full NuGet clear and restore then run dotnet restore --force in the NPM console, after which all those error messages were gone. As well as this, the original IIS Administrator error was gone too, presumably fixed via the original reinstall of Visual Studio.
Lost a whole day to this quagmire.

Downloading & Installing IIS Express from Microsoft worked for me. No need to update VS or remove/re-add the project.

Related

Visual Studio Update Paused - Now cannot be resumed, modified or removed

First of all, I am trying to open a support request with Microsoft about this issue, but their support reporting portal isn't working. I have resorted to Stackoverflow because I have no way of getting to Microsoft.
Yesterday, I started updating Visual Studio 2022 from Visual Studio Installer by mistake and paused it shortly after. Today, I tried to open a project but Visual Studio seemed unavailable. At that point I remembered about the paused update and re-opened the Visual Studio installer. I tried to Resume, and I got the below error. The Modify and Remove options give out the same error too. There is no Repair option.
Sorry something went wrong
The dependent package of
'Microsoft.VisualStudio.Debugger.Concord,version=17.1.33203.90,productarch=x64'
cannot be found: Microsoft.VisualStudio.DebuggerClient.Concord,
version=[17.0,18.0].
I also tried Restarting and deleting temporary files using the Disk Cleanup tool - no difference.
I have tried to force an uninstall from the Add or Remove programs but this still redirects me to the Visual Studio installer.
I have tried to research this error online but found nothing.
I did not fix the issue but at least I managed to uninstall the Visual Studio instance to be able to start from scratch again. If you do not want to go down the route of uninstalling, feel free to try the steps as suggested by #garbagecollector.
I deleted the installation folder for 2022 from ProgramFiles.
I deleted the Visual Studio installer from Add or Remove programs. (Note: This actually uninstalled a working version of Visual Studio 2019 that I had, and left the messed up version of 2022 with the same issues, so beware if you do not want to uninstall another working version of Visual Studio)
Then I ran InstallCleanup.exe via CMD (in admin mode). Refer to the "Remove All with InstallCleanup.exe" section within this article. This seems to have cleared all Visual Studio related files including the Visual Studio
installer, and I could re-download the installer for Visual Studio
2022 Community edition and start afresh.
I faced the same issue today and could solve it by removing corresponding dependencies from _package.json files from C:\ProgramData\Microsoft\VisualStudio\Packages\[PACKAGE_NAME] folders.
I am not sure whether you can repair your installation this way, I tried only with uninstall.
So in your case edit this file:
C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.VisualStudio.Debugger.Concord,version=17.1.33203.90,productarch=x64 and remove the line marked with "-->" under "dependencies":
{
"id": "Microsoft.VisualStudio.Debugger.Concord",
...
"dependencies": {
...
--> "Microsoft.VisualStudio.DebuggerClient.Concord": "[17.0,18.0]"
}
}
In my case I had to repeat this procedure for three or four _package.json files.

Visual Studio 2015 Extensions Manager Index was out of range error

Env: Visual Studio 2015 Community Edition on Windows 8
Trying to open Tools --> Extensions and Updates results in the following error in a message box:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Tried running as Admin, same result.
I've tried looking at the log but nothing mentions that error.
In the log there are 3 error entries related to extensions which could be related, they say the following:
Error loading extension: Could not find a part of the path 'C:\path\to\APPDATA\LOCAL\MICROSOFT\VISUALSTUDIO\14.0\EXTENSIONS\ZW2UF5JV.JVN\extension.vsixmanifest'.
The other 2 are identical except the odd string at the end is HQ1Y5EQD.TMG and 3KWE1LJF.Z1W.
Interestingly, just before those errors in the log appear, there is a line for each saying the extension was loaded successfully but if I try to go to the path it's got listed, it doesn't exist.
I can't find any reference to those strings on my machine. I've also searched the registry but can't find any reference in there either.
I can get into the Extensions manager if I click on one of the update notifications but the original error message just displays in the main pane and I can't do anything else. I can get to the online window but as soon as I click an extension, I am prompted with the original message.
I haven't installed any extensions or VS updates for a while but my Web Compiler extension extension has stopped auto compiling JSX files which is why I started trying to look at the Extension manager. I'm guessing the issues are related.
I can still work, compiling can be done manually which is inconvenient but not the end of the world. My worry is some other extensions are also misbehaving and I just haven't noticed yet.
Don't really want to re-install VS as a) it took ages last time and b) it might not fix the issue. Is there any good advice on troubleshooting the error or anything else I can try before I re-install?
I refreshed the GitHub extension on VS 2015 and got this error. Deleting the two cache files:
extensions.en-US.cache
extensionSdks.en-US.cache
from the AppData\Local\Microsoft\VisualStudio\14.0\Extensions causes them to be rebuilt and eliminates the error.
No reinstall needed.
Problem got worse, I started getting the error message when starting Visual Studio and things like the package manager wouldn't load. Each restart seemed to yield a different combination of windows not loading, sometimes Solution Explorer, sometimes Team Explorer etc. Not good.
A repair to VS 2015 via the Control Panel took a while but didn't help, same problems.
I ended up completely uninstalling and trying to re-install. However the installer threw an index was out of range error but weirdly VS 2015 was now listed as an installed application again.
So I'm guessing the original uninstall left some problematic files lying around which messed up the next install. So I uninstalled again, renamed Microsoft Visual Studio 14.0 folder, cleared all files from AppData\Local\Microsoft\VisualStudio\14.0\Extensions and re-installed.
It installed and ran fine.
The problem I now had was that I couldn't find the SQL Server Object Explorer window anywhere. I tried repairing SQL Server Data Tools but still no luck. So I uninstalled SSDT and then re-installed. This seemed to fix it.
Now I realised I also couldn't connect to Azure through the Server Explorer window, the option was simply not appearing in the list like it used to. This time a repair to Azure Tools for Microsoft Visual Studio 2015 - v2.9 and a repair to Azure App Service Tools v2.9 - Visual Studio 2015 fixed that problem.
I confronted same issue and found this thread. I tried the above suggestions, but unfortunately, it went all unsuccessful. I even tried to uninstall/install with even worse result as Visual Studio became unable to start due to new "missing components" issue. Reinstallation was nothing better.
I finally came by a piece of magic. It was Visual Studio Uninstaller which although would remove all your installed extensions, it would perform a complete cleanup. It would save you from installing new Windows (at least it was my case.
Just go to releases and download the first zip file
This way you will be able to perform clean install of Visual Studio.

Package Manager Console Error

When I start visual studio express 2012 for web I get this error in the package manager console.
Cannot load Windows PowerShell snap-in Microsoft.PowerShell.Core because of the following
error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions
property for more information.
Loader Exceptions:
Exception of type 'System.OutOfMemoryException' was thrown.
I don't remember adding anything new to visual studio. I searched other related problems but they don't work for me.
I tried repairing visual studio. I also tried re-installing visual studio which temporarily removed the problem but it is back again.
Anyone has a solution?
I finally made it work. I suspected it is something from windows update that messed up with my VS since I didn't really add anything to VS. I am not sure which updates to remove so I just uninstalled all the windows update that starts in a certain date. Here are the actual steps that I did:
What I did is uninstalled visual studio 2012 express for web following this tutorial.
And then uninstalled windows updates starting from the date I believe the error started appearing.
After I used CCleaner to clean my registry. Had to run it 2 times to just to make sure it is clean. I'm not sure if this actually helps. I just heard from my friend that uninstalling applications sometime leaves registry keys behind.
Finally, I installed visual studio again. Package manager is back to normal.
Restarted my laptop and it is still working. So I guess it is solved.
I think System Restore would do solve this instead of doing all this steps. But system restore was not an option for .

VS2012 Javascript Debugging Won't Work

For the last 2 days I have had a right pigs ear of a problem that I just have not been able to get past.
Any time I try to debug an Windows 8 store JavaScript app using VS2012 on my laptop I get the following error:
>Unable to start debugging 'C:\Windows\system32\wwahost.exe'.
>
>Microsoft Visual Studio Debugging Monitor (MSCVMON.EXE) failed to
>start. If this problem persists, please repair your Visual Studio
>installation vis 'Add or Remove Programs' in control panel.
This happens when I try to debug locally and in simulator.
This only happens for javascript projects, all other types of projects work fine.
So far the steps I have taken are:
repaired installation
installed update 1
Added all application packages to program files (x86)\Common Files\Microsoft Shared\VS7Debug on security tab.
uninstalled and re-installed
Nothing has worked.
Interestingly this error is about remote debugging which I am not trying to do, I didn't have remote debugging installed for 2012 but it was installed on my system for VS2008.
I installed it for VS2012 and opened the monitor while I tried to debug and nothing showed in the log.
I did an install using same VS2012 DVD on a fresh win8 desktop installation and it has no issues it all works fine although it did ask me on first run to set the permissions (I cant remember if it did this on my laptop).
I think the problem came when installing on my laptop it asked me if I wanted to import setting from previous versions of Visual Studio and I said yes.
I have done constant internet searching on this topic for last 2 days and some people are saying the problem is caused by VS2012 trying to open some VS2008 files but how to fix this is not clear.
When I uninstalled VS2012 and re-installed it didn't ask me if I wanted to import settings so I think I didn't fully un-install it (it still had a list of my recently accessed projects after the re-install).
Sorry for the long post but this has driven me crazy and I just cannot think of what to try next. Can anyone please help?

Visual Studio crash at start-up

My Visual Studio began crashing at start-up. In my search for finding a remedy, I found these two suggestions, but neither worked for me:
Launching Visual Studio while running in safe mode, and
Running repair on Visual Studio.
However, I found that if I logged into a different Windows account, Visual Studio was able to run from that account without crashing.
Here is an error code that that I observed in the crash report:
LCID: 1033
Can anyone provide a solution for returning my Visual Studio to working order?
For me it turned out to be the plugin that GitExtensions installed into Visual Studio 2013.
-- UPDATE: try this before uninstalling GitExtensions
#Enceradeira proposed in the comments to uncheck the Show current branch in Visual Studio option. In GitExtensions, you get there via Tools -> Settings -> Appearance:
-- END OF UPDATE
After uninstalling GitExtensions and reinstalling it with all VS plugin unselected my VS runs smoothly again.
I even put together a blog post about this issue because it bugged me so much.
Since you're able to run with another user login, something may be wrong with your local settings, you can try to reset them: devenv /resetsettings in Start menu -> Run.
Warning: this will restore visual studio to default settings.
In my case VS used to crash on a single solution. I resolved the problem by deleting the respective solutions's user file: SolutionName.suo
My colleague recently experienced a problem with Visual Studio 2013 crashing on start-up. Unfortunately, we found that the approach recommended in the answer by #Arun M did not solve the problem:
devenv.exe /ResetSettings
...however, using a different command line argument did:
devenv.exe /ResetUserData
An easy way to run devenv.exe is via the Visual Studio command prompt; on Windows 10, it can be found here:
Start Button => All Apps => Visual Studio 2013 => Visual Studio Tools =>
VS2013 x86 Native Tools Command Prompt
For more about these command line arguments for devenv.exe, see this answer to this related question: How do I truly reset every setting in Visual Studio 2012?. ⚠ In particular, please note the cautionary statement in that answer about the /ResetUserData command line argument!
Try to run VS as administrator. That's necessary in my case.
If coincident to these Visual Studio crashes you are getting "Heap corruption" (Exception code: 0xc0000005) errors in your Windows Application log (Faulting module name: WindowsCodecs.dll), here is something worth checking into: A faulty WIC component within Expression Blend can cause ALL versions of Visual Studio to crash upon launch, as well as cause Internet Explorer to crash upon visiting many, if not most sites. Even though Microsoft distributes this component, they call it a "non-Microsoft component". As such, a Visual Studio reinstall won't fix this,, an OS reinstall over existing Windows installation won't fix this, and a system file integrity check won't detect it.
If my case, the misbehaving codec was "C:\Program Files (x86)\Microsoft Expression\Common\Imaging\4.0.360.0\PSDCodec.dll", and simply unregistering this component got my Visual Studio working again from consistent startup launch crashes.
I post this in hopes this solution to one source of Visual Studio crashing might save others from the $500 Microsoft support incident fee and week of downtime this caused me.
I just changed the windows language in the bottom right to "EN", then started as admin. And it worked, interesting..
I had the very strange phenomenon that both Visual Studio 2010 and 2013 on a Windows 7 machine crashed when run in a remote desktop session, started from a Windows 10 pc. Debugging the crash showed a CultureNotFound exception. It was caused by regional settings on the Windows 10 pc, which could not be translated in something understood by Windows 7. I had language English(Belgium) with an Azerty keyboard. I added and selected English(UK) with an Azerty keyboard and the crashes disappeared. No other programs suffered from this.
For me it was being caused by Web Essentials and I was able to resolve by disabling it, restarting VS, enabling it back , restart again. Works now.
I had a crash on startup (or soon after startup, before opening any solution) occurring in git2-msvstfs.dll, caused by placing a 3GB temp file into a directory within my solution. Deleting the file fixed it.
Once I accidentally pressed a random key combination (maybe something like ctrl+', but I didn’t realize I was holding ctrl down so I forgot what keys I hit by the time I realized something bad had happened) that resulted in VS Professional 2017 15.3.5 crashing within half a minute. After relaunching, I found that VS would be interactive for a few seconds before it would crash within half a minute. It was really too fast for me to try to figure out what I had accidentally activated or for me to disable it before VS would crash. Also, it would even crash if I didn’t open any solution, so I figured it was not something that deleting a .vs (per project/solution Solution Explorer/open files state) folder would fix.
To fix, I followed Arun M’s comment and renamed my %LOCALAPPDATA%\Microsoft\VisualStudio\15.0_3f4d04be folder. You will need to adjust the path for the edition/version of VS that is crashing. On my machine, I think 15.0_3f4d04be is Professional and 15.0_0fed6c59 is VS Community Edition. You’ll probably have to guess based on the folder’s modification timestamp which is probably going to reflect the date you last used that edition of VS.
After renaming the versioned dotfolder, VS launched without crashing. It started with default settings but automatically restored some of my settings through the cloud sync stuff after a minute of running and it even remembered my account information so I didn’t need to sign in.
I did not need to rename my %LOCALAPPDATA%\Microsoft\VSCommon folder (which Arun M had also suggested).
I had a similar problem, both VS2015 and VS2013 would crash at startup. Tracked it down to an application I installed which put .net 4.7.2 on the system. Once i removed that app, removed .net, and reinstalled .net 4.6, Visual Studio started working again.

Resources