Reputation: 3648
What I'm doing:
Deleting applicationhost.config
, located in Documents\IISExpress\config
, doesn't change the error message. (There's also an IISExpress
folder in program files
and program files (x86)
.)
Something I noticed, and I don't know if it's a problem:
Referenced file 'lib/jquery-validation/jquery.validate.js' not found.
I got a dump with rawcap but I don't notice much in there. Some of what was there:
"Framework":{"FrameworkName":"DNXCore,Version=v5.0","FriendlyName":"DNX Core 5.0","ShortName":"dnxcore50","RedistListPath":null}
I don't notice a problem, but I have the network data if that can help figure out why I cannot connect to the web server. I get a RST,ACK
immediately so I'm guessing the port is closed and whatever this web server is, isn't being setup.
More on this problem: 800700c1 error from /trace:error
I've tried:
Upvotes: 359
Views: 454237
Reputation: 367
Maybe this is late but in my case I needed to change the port number I am using in lunch file as it was occupied by some other service
Upvotes: 0
Reputation: 380
I had this issue, and it turned out to be because the server was failing due to unapplied database migrations.
A simple Update-Database
package manager console command for EF Core fixed this for me.
Upvotes: 1
Reputation: 69
Something that worked for me based on this
Make sure iplisten is configured to 0.0.0.0
If the IP listen list is not configured, this issue may occur (caution, I have no idea why).
Check netsh to ensure there is an entry for 0.0.0.0 In command prompt type:
netsh http show iplisten
There should be:
If it does not appear on your prompt, add the correct correct netsh rule. You'll need an admin cmd.exe or admin PowerShell for this.
In command prompt type: netsh http add iplisten ipaddress=0.0.0.0
Upvotes: 0
Reputation: 965
If you made it this far, you are clearly desperate. Good luck to you and your pursuit to find happiness again.
Did you just merge code in from another branch? Did you accidentally merge in duplicate entries in the Program.cs file? (I'm using .NET Core 6)
For me, there were duplicate entries for both:
builder.Services.AddDatabaseDeveloperPageExceptionFilter();
and
builder.Services.AddDefaultIdentity...
Not sure which one caused the issue but fixing the merge resolved the problem.
Upvotes: 0
Reputation: 119
-> close visual studio -> delete .vs file -> delete launchsettings.json
restart visual studio...
hope that solves your problem
Upvotes: 0
Reputation: 163
I disabled the SSL in debug properties and then enable it again. It worked like charm.
If you can afford to restart your system, do it.
Upvotes: 0
Reputation: 1003
Ending the IIS worker process in the task manager helped me solve this issue.
Upvotes: 0
Reputation: 4756
After installing Update 2 for Visual Studio 2015 I started getting the same error. I tried everything above with no luck. However, I found a solution that works for me:
YourSolutionFolder\\.vs\config\applicationhost.config
file (note: .vs is a hidden folder)If you have IIS configured to use the same port, (stop the application / use different port) and try again.
Upvotes: 435
Reputation: 161
My issue was similar to what others have said, but a slightly different flavor that may help someone. I am running VS 2019 and .NET 5.0 ASP.NET.
TL;DR
Ensure socket bindings in .vs\...\applicationhost.config
and launchSettings.json
for the project and selected configuration the match the current enabled NICs :).
Details
I had been mucking with my .vs\...\applicationhost.config
and launchSettings.json
to be able to host not just on localhost, but on my NICs IP address/port (socket) for testing on another device. Recently, I added a second socket to have a colleague test something over a VPN. When the VPN was not connected, I could not start IIS.
I reconnected the VPN, and everything started working again. Then after disconnecting the VPN, I updated launchSettings.json
(and restarting VS2019), but forgot to update the bindings in applicationhost.config
. I believe IIS Express still worked hosting one more time, but the 2nd time it would not. It was then that I realized I still had the VPN socket in the applicationhost.config
bindings. I updated it, restarted VS2019 and all was well.
Upvotes: 0
Reputation: 2225
Depending on what caused the issue the solution may be far more simple than those proposed above. I have seen this fault arise when I renamed my project directory or a folder within which it is contained. Renaming the folder structure back to what it was solves the error for me. Ofcourse this isn't the perfect solution in the event you would genuinely like to change the folder structure.
Upvotes: 1
Reputation: 922
I had this issue on .net core 2.1, visual studio version 15.9.6. When i deleted the .vs folder, i reopened visual studio and the problem was still there. The solution that worked for me below:
Other Solutions:
Upvotes: 51
Reputation: 2205
If you can afford to restart your machine then do it 👌, this fixed my issue after almost an hour of trying to fix this issue with no hope 🤯.
Upvotes: 9
Reputation: 1224
Instead of debugging with the IIS Express profile, I recommend debugging with the profile named after your project. It works fine for me. I'm never going back to IIS Express!
Upvotes: 1
Reputation: 81
I was trying to launch the app on the URL "http://192.168.0.1:4000/", and the above answers didn't help.
Finally, I added the *:4000:localhost
HTTP binding to the .vs/.../applicationhost.config
, so now the binding section looks like this:
<bindings>
<binding protocol="http" bindingInformation="*:4000:localhost" />
<binding protocol="http" bindingInformation="*:4000:192.168.0.1" />
</bindings>
And it did the trick
Upvotes: 0
Reputation: 11
I've tried all listed here, but nothing really helped. Solution was simply to change IIS server port listening (apparantely port 80 was already taken, but the error message didn't said so).
Btw. in my case port 80 was taken by main windows service which I couldn't stop/kill...
From main ISS manager, go to Default Web Site and edit bindings (below screenshot is in Polish - hope it helps anyway)
Then I've changed port 80 from http binding to (whatever you like) 8081 as below:
So after that all projects(web page, apis) started working correctly.
Upvotes: 0
Reputation: 2670
Copied my comment to an answer by request.
For Net Core 2.2 project - After a MASSIVE struggle and trying everything from deleting .vs folder, deleting IIS Express configs, changing port numbers, changing bindings, and to running VS as admin I FINALLY fixed issue by
It was not apparent that the file was corrupt or incorrect or even when it changed to cause failure.
Upvotes: 41
Reputation: 3119
Exit VS and delete the (project)\.vs\applicationhost.config
file. Restart VS. It should start working.
Upvotes: 292
Reputation: 135
As Svenmarim already stated, this mostly occurs because the ip adress is already in use.
This answer and its comments from the visualstudio developer community pointed me to the right direction. In my case i was trying to access my local IISExpress instance from my local network and therefore binded my ip adress with the same port which uses my IISExpress instance via
netsh http add urlacl url=http://192.168.1.42:58938/ user=everyone
After removing this binding via
netsh http delete urlacl url=http://192.168.1.42:58938/
it worked again.
Upvotes: 0
Reputation: 680
Restart your computer, that will work, at least it did it for me.
Upvotes: 1
Reputation: 2603
For me it was very easy.
Upvotes: 0
Reputation: 878
First: remove .vs
folder from project (aside .sln
file), then open project.
Good luck
Upvotes: 2
Reputation: 345
Faced the issue when reinstalled Windows on C: Drive, but my Visual Studio projects were intact on E: drive after the installation. I have resolved the issue by removing .vs folder in the visual studio project folder.
Upvotes: 0
Reputation: 101
If you don't want to reboot your can, a solution is to manually attach the debugger. In my case the application is launched but visual studio fails to connect to the iis. In Visual Studio 2019: Debug -> Attach to process -> filter by iis and select iisexpress.exe
Upvotes: 0
Reputation: 143
If you are using VS 2017 or VS 2019 with ASP.Net Core, you can directly go to launchSettings.json under Properties folder and just change the Port number of applicationUrl key for iisSetting.
Upvotes: 5
Reputation: 590
in my case it was pulse secure vpn tripping up Visual Studio 2019 community edition for some reason ! workaround is to suspend vpn, start debug solution, then resume vpn connection.
Upvotes: 1
Reputation: 1737
With the Visual Studio closed, I deleted the temporary folder iisexpress
in: C:\Users\<your_user>\AppData\Local\Temp\iisexpress
.
Upvotes: 1
Reputation: 3218
In my case this error was caused because I was running Docker.
Make sure the port you are trying to host on is not in a Port Exclusion Range by running the following command in cmd/powershell session:
netsh interface ipv4 show excludedportrange protocol=tcp
I tracked this down after reading through this stackoverflow question:
Unable to launch the IIS Express Web server, Failed to register URL, Access is denied
Steve
Upvotes: 0
Reputation: 12181
In my case (using ASP.NET Core 3.1 and Visual Studio Professional 2019), I've seen this twice and in both cases fixing it was as simple as rebooting my PC.
I strongly suspect, but can't prove, that this could also be accomplished by restarting only a specific process (like in @Codenova's answer).
Upvotes: 1
Reputation: 23
if you copy the project from other pc. you can try
netsh interface ipv4 show excludedportrange protocol=tcp
to check the Start Port to End Port that is allowed to use on you computer
Upvotes: 1