I'm developing an ASP.Net Web Form application and an ASP.Net Api. They are two different projects, have nothing to do with each other, but both have problems with IIS Express.
VS Studio 2022 is updated, no firewall or virus scanner is interfering
With both projects I have the problem, that the IIS Express does not deliver anything.
I even uninstalled and reinstalled Visual Studio 2022 and started a whole new project - which gave me the same result:
When I start debugging,
- the memory usage of the app (shown in VS, process memory) is only about 18 MB - I know it should be at least around 200 MB or above!
- The Browser starts (trying to show swagger in case of API or the web page in case of the Web Form App) and shortly after that shows, that localhost has refused the connection.
- In the status bar the IIS Express icon is there, the web application is running and it shows me a http and a https connection for it with according ports.
But I can't access the information from the API or the web pages.
In Case of the API: When I change to http or https instead of IIS Express, the API works and I get a swagger browser window.
With the web form app I don't have such a possibility.
I tried several things:
- ran VS 2022 as Admin
- deleted the .vs folder in all three projects
- deleted the IIS Express sub folder in the documents folder
- changed the ports numbers in the applicationhost.config in the .vs/... sub folder
- restarted my PC several times
Additional information:
A few days ago I deleted the SSL certificate for localhost and build a new one in the Nuget Package Manager Console with
dotnet dev-certs https --clean
dotnet dev-certs https --trust
dotnet dev-certs https --check
I did it. because in the API Project I could not access the https address (outside of the IIS Express, which was not working). This is possible now.
As mentioned above I get now that very low process memory usage.
Before the new SSL certificate, when tried to debug the web form app on IIS express, the memory usage was higher and I got an error message popping up that said that IIS could not be reached, but in the same message only one line below it stated that IIS Express started properly and managed to "connect" (could be wrong here, I don't remember the exact phrase) to the ports on local host.