There is an issue when I debugging my backend net5.0 project. The issue is "Web server failed to listen on port 5001" then I changed port but the problem does not change.
I had the same issue after loading one of the existing project. I was able to resolve this by installing the .NET version project was targetting. (In my case, it was .NET 5).
Reason for the error: Since .NET's previous versions are out-of-support, Visual Studio won't install previous versions during installation.
Remedy: Intall SDK by yourself after installing Visual Studio
In my case that was
app.Run();
line deleted accidently from Program.cs
For me the issue was that i added some configuration to the appsettings.json file and i forgot to add a comma. fixing that and everything was back to work.
If you are using application url with port and you are using different url port in the environment variables settings in some field like origin. Then this problem arises. You have to keep them same.
I had a similar Issue after updating my packages, to fix it:
Make sure that the DotNet version in the csproj is the same as the version found in the following folders:
C:\Program Files\dotnet\shared\Microsoft.NETCore.App C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App
So my csproj
was contained:
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.4" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="7.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.4" />
</ItemGroup>
So I made sure that all the File locations specified above the csproj file had versions 7.0.4.
For me, this seemed to be caused by the random signing out of my Microsoft Account in Visual Studio 2022. As soon as I re-entered my creds, it went away.
© 2022 - 2024 — McMap. All rights reserved.
netstat -ab
to check. – Aracelyaraceous{ "$schema": "http://json.schemastore.org/launchsettings.json", "profiles": { "Gateway.Command": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", "applicationUrl": "https://localhost:5001;http://localhost:5000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Local" } } } }
this is my launchSettings.json – Kittenwaiting for the web server to listen on port 53855
and then same resultweb server failed to listen on port 53855
– Kitten