Release via cli
ASP.NET Core project is actually console application. Our project always contains a Program.cs file just like a console app.
-
modify program.cs, add IIS or Kestrel integration
public class Program { public static void Main(string[] args) { var host = new WebHostBuilder() // kestrel .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) // iis .UseIISIntegration() .UseStartup() .Build(); host.Run(); } }
-
command line >
dotnet publish
a folder
publish
will be created -
IIS > create a new website > copy the
publish
folder > set .net core as runtime