How to run net 6 core application inside virtual directory i,e inside the default web site on IIS.
Loading
How to run net 6 core application inside virtual directory i,e inside the default web site on IIS.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jayraj ChhayaPosted Jan 11, 2024, 6:29 AM
To run a .NET 6 Core application inside a virtual directory on IIS, you need to follow these steps:
Now, your .NET 6 Core application is configured to run inside the virtual directory on the default website in IIS. You can access it by navigating to the virtual directory URL in a web browser.
Please note that these steps assume you have already installed the necessary prerequisites for running .NET 6 Core applications on your server, such as the .NET 6 runtime and hosting bundle.
Anandu G NathPosted Jan 11, 2024, 3:46 AM
To run a .NET 6 Core application inside a virtual directory, you'll need to make some adjustments to your project and possibly the hosting configuration. Here are the general steps:
Update Your Project File: Open your
.csprojfile and make sure it has the following configuration:Configure Application Base Path: In your
Program.csfile, update theWebHostBuilderto set the base path for your application:Sam HobbsPosted Jan 10, 2024, 4:38 PM
This depends on whether it is for production or not. If not for production and if for only use locally then you can use the Kestrel server that is included in the application by default. You can use
dotnet runto do that.The following article is Microsoft's instructions for hosting an ASP.NET Core application on Windows using IIS.
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-8.0