I am using Microsoft Visual Studio 2019 Community preview, version 16.4.0 Preview 1.0. I just update to Windows 10 Pro Version 1903 OS build 18362.418 . With ASP.NET Core 3 web-app project (Blazor Server), When I press F5, I catch error
I can go to https://localhost:44333/ manually, but it is inconvenient. When I stop debug, I also turn off it manually at taskbar.
With another web-app project, the problem is not happen.
When I choose or not choose option Enable native code debugging
, not success.
How to fix it?
Best Answer
Enable/disable SSL
This is the easy fix. For me, toggling the "Enable SSL" setting in the project Debug tab inside Visual Studio (just change it to the opposite of what is currently set and run the project) has fixed the issue.
As I understand it, there are two reason this might work. First it causes Visual Studio to update the Applicationhost Config (more about that later). Secondly, sometimes the SSL address is bound. Therefore disabling SSL disables the problem.
Applicationhost Config
Open your
$(solutionDir)\.vs\config\applicationhost.config
file and ensure your site looks like 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
Add the correct netsh rule if it does not exists. You'll need an admin cmd.exe or admin PowerShell for this.
Ensure nothing is binding to the address you are using
This seems to be an issue with Blazor for me. If an address is binded to the address Blazor is trying to use, this can cause issues. Use
netsh
again to check what is in use.An entry that looks like this
Can be deleted with this command