Reputation: 105
Usually, when developing ASP.NET, I host the root of the project in IIS. This helps me to just build and directly access the web application in the browser without launch it in visual studio debug mode.
Here is how I set up IIS in ASP.NET MVC :
I can open the site in browser simply just typing localhost/site-name with the above setting. But this method seems doesn't work in ASP.NET Core MVC.
I have set the application pool to no managed code as it is required for .net core.
But the browser just display the directory
So far, i have to do either below process in order to view the site in browser properly :
But it kindly slows down the development process in my opinion.
Upvotes: 1
Views: 786
Reputation: 18205
Checkout the docs for hosting ASP.NET Core in IIS
There is a reference to the ASP.NET Core Module for IIS which is described as:
The ASP.NET Core Module is a native IIS module that plugs into the IIS pipeline to either:
- Host an ASP.NET Core app inside of the IIS worker process (w3wp.exe), called the in-process hosting model.
- Forward web requests to a backend ASP.NET Core app running the Kestrel server, called the out-of-process hosting model.
So you will need to have this module installed in IIS for your setup to work correctly.
That said, there is an easy way to run ASP.NET (Full Framework or Core) applications in Visual Studio without having to debug to run the app.
Instead of clicking the green "Play" button every time you want to run the site, go to the "Debug" menu at the top of the window and select "Start Without Debugging".
The application will start and launch. Then when you make changes you only have to rebuild the project. The next time you make a request to the application in the browser the app will serve results using the latest changes.
You don't need to re-run the application every time you make changes - it's always running!
If you want to Debug after having started the application using "Start Without Debugging", you can "Attach" to the IIS Express process and start debugging.
Open the "Debug" menu, select "Attach to Process", filter the list for "iisexpress", and select that process.
Visual Studio will load debug symbols and allow you to hit breakpoints.
Then when you want to stop debugging, hit the red "Stop" button. You will detach from the process, but the application will continue to run.
You can attach and detach as many times as you want. Just make sure that after you make changes to your code you re-build the project before attaching to make sure the correct debug symbols are loaded.
Upvotes: 1