iis express always reports port in use - visual-studio

Visual Studio Community 2019 16.10.0
Pressing [IIS Express] to debug...
Regardless of which Port I use, I get:
Log:
Failed to register URL "http://localhost:59001/" for site "...." application "/". Error description: The process cannot access the file because it is being used by another process. (0x80070020)
Rebooted, deleted 'vs' folder, reinstalled VS 2019. Still the same error. Does anyone know what could be causing it?

Choosing the "Repair" option on Visual Studio fixed it. But uninstall/reinstall did not?!?

Related

Visual Studio 2019: "This site can’t provide a secure connection" on localhost

I've installed Visual Studio 2019 and uninstalled Visual Studio 2017.
Now if I start an ASP.NET (Core) site with https, it always say on Chrome:
This site can’t provide a secure connection
or on Edge
Can’t connect securely to this page
Screenshots:
Chrome:
Edge:
The URLs are correct. This also the same http://localhost:56784/ (it redirects to https)
Tried
What I've tried:
Updated Visual Studio 2019
Create a new ASP.NET Core 2 website
Tested with a ASP.NET site (non core)
Remove IIS certificates with MMC
Checking/changing the IIS settings in Visual Studio 2019 (project properties with context menu and project properties with F4)
Searching on Stackoverflow & Google ;)
Repair Visual Studio 2019
Issue
I think the issue is introduced by:
Installing Visual Studio 2019 and/or,
Uninstalling Visual Studio 2017 and/or,
Updating Windows 10 (current Version: 10.0.18362 Build 18362)
The underlining issue looks like a wrong/old/not supported TLS version?
Question
What can I do to diagnose/fix the problem?
Just as it did not work for #Nosnetrom - repairing IIS 10.0 Express did not work for me either. As #Julian mentioned my problem was caused by uninstalling VS 2017 as well.
This is what did not work for me:
uninstalling / re-installing VS 2019
installing VS 2017
uninstalling / re-installing / repairing IIS 10.0 Express
This is what worked for me:
after reading this advice - I realized that I was using port 51542 instead of a port in the range of 44300 through 44399
then I updated the applicationhost.config file according to this advice. The location of said file on my Windows 10 machine is: C:\Program Files (x86)\IIS Express\config\templates\PersonalWebServer\applicationhost.config. I had to open that file in Notepad ran as an administrator otherwise I could not save these changes:
then in Visual Studio I created a new virtual directory
that seemed to have done the trick for me - when I ran the application it worked
Repair of IIS Express fixed my problem:
For those who all the above methods didn't worked:
open a command prompt and then run:
dotnet dev-certs https --clean
and then:
dotnet dev-certs https --trust
None of the above solutions worked for me, Following steps worked for me.
Go to chrome or edge browser and type chrome://net-internals/#hsts
search for localhost in query domain, you will find lists of domain including localhost. Now delete the domain
Delete the domain by typing localhost
Just follow below steps:
Close Visual Studio
Delete .vs folder
Restart Visual Studio
Build and Run the Application
As per my understanding, .vs folder keeps the old settings inside the applicationhost.config file. So better to delete all cached settings and start with fresh.
None of this worked for me. What did work (and it's not as drastic as the other answers)...
Go into web project and set Start URL and Project URL to this: https://localhost:44365/
Save (but don't run the Project).
Edit .vs/[ProjectName]/config/applicationhost.config and change the bindings for the web project to this:
<binding protocol="https" bindingInformation="*:44365:localhost" />
<binding protocol="http" bindingInformation="*:53269:localhost" />
Reopen Visual Studio and when I started the website it worked.
I solved this problem as follows;
run the web project in debug mode on Visual studio 2019.
if it's on chrome you should do this ;
In my case use SSL check box was gone in debug section of project properties. everything was fixed by checking again
Right click on the project, select Properties, 'Debug', check the checkbox "Enable SSL", that's it, worked with me by doing this
If you 'are using services.AddHttpsRedirection like
services.AddHttpsRedirection(options =>
{
options.RedirectStatusCode = (int)HttpStatusCode.TemporaryRedirect;
options.HttpsPort = Configuration.GetValue<int?>("https_port", null);
});
Make sure HttpsPort is null or a valid port in appsettings.json or appsettings.Development.json file.
Clear your browser history and cookie

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

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.

Microsoft Visual Studio Community 2015 setup blocked

When I try to install Microsoft visual studio 2015 community it gives me error "setup blocked" and writes "The computer needs to be restarted before setup can continue. Please restart the computer and run setup again"
visual studio error
I tried to restart in various ways (for example canceling hibernate), but every time I get the same error. I tried to look it up, but couldn't find any solution that worked for me.
The full log of the error can be found here.
It might be important to mention, that at the moment I have visual studio 2012 on my computer, but if I try to uninstall it, I get the same error that the computer needed to be restarted.
Thanks.
edit:
I found a solution that worked for me (for all who encountered this problem):
http://www.itexperience.net/2009/06/25/bypass-pending-reboot-of-automatic-updates-0x8ddd0007/
In the registry there is a key (RebootRequired) which tells that you need to reboot your machine.
The problem was that the key existed when it shouldn't have (created on another time, but wasn't deleted afterwards).
By entering to registry and deleting this key, the problem is solved.
You can find the key at:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\
based on:
http://www.itexperience.net/2009/06/25/bypass-pending-reboot-of-automatic-updates-0x8ddd0007/
You can temporarily override "Restart" requirement for Visual Studio installation.
Use
ignore-restart for Visual Studio .

Visual Studio 2012 Break points not hit

I am having an issue with Visual Studio 2012 where break points are never being hit unless I enable
'Allow the source code to be different from the original version'
When, I do this I get a warning that the source file differs from the debug version.
I have reset the settings in visual studio and this has made no difference. I have also created a blank project and the same thing still seems to be happening.
To try and fix this I have:
1) Rebooted the pc
2) reset all VS settings
3) Created a new blank project
Any would would be appreciated.
I have seen this occur when an IIS express process gets hung up. Please close all instances of Visual Studio 2012. Then open up windows task manager and find all process that have the image name of iisexpress.exe and make sure to end those process. Then restart VS2012 and you should be good to go.

Visual Studio 2012 Side by side configuration is incorrect

When I run Visual Studio 2012 Professional I get a side by side configuration error message.
Message:
"C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe
The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the commande-line sxstrace.exe tool for more detail."
Event log:
"Activation context generation failed for "C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe". Dependent Assembly coloader80.dll,processorArchitecture="X86",type="win32",version="1.0.0.0" could not be found. Please use sxstrace.exe for detailed diagnosis."
sxstrace.exe: http://pastebin.com/qgS3Sx8c
I've already installed vcredist_x86
I'm running Windows 7 Professional
I had the same issue in that several files were not copied over to the VS2012 directories and it caused the 'side by side' issues. In my case I was installing from a drive that was on the network. After installing / uninstalling / reinstalling over and over without success I finally moved the install media to my local hard drive. Then, I was able to uninstall and then reinstall successfully. I believe the problem is that when the install has to reboot and continue installing it can't find the install media 'in time' so then it fails. If you are installing from a 'remote drive' I would suggest moving the install media to a local drive and then trying again.
I encountered this problem today and found a crude way to solve it for me, without analyzing logs and looking for missing .dlls.
I opened up the system configuration and was about to de-intall VS2013 RC, when I realized there was an repair option. Trying this brought no effect, but I also saw that VS2012 for windows desktop and vs2012 for web were still installed.
So after a reboot this finally fixed my side-by-side error:
Cleanse the machine of any previously installed Visual Studio versions.
Reboot.
Repair the installed (and only left) version of Visual Studio
Reboot.
Maybe this is of use for everyone else who is encountering this problem in the future.
Kind regards

Resources