- Let's create a new ASP.NET Core project and serve it in IIS:
dotnet new web
- Open the Program.cs file and look for the following code block:
public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>() .Build();
- We should add a UseIISIntegration() method call in that function as follows:
public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>() .UseIISIntegration() .Build();
UseIISIntegration() method makes the ASP.NET Core application to use IIS as a reverse-proxy and specify which port will be listened, and ...