Below are instructions on how to deploy ASP.NET Core app to an environment that doesn't include ASP.NET Core (i.e. where all the assemblies are included) for Visual Studio 2017.
1) Start Visual Studio.
2) Open a new project by selecting File -> New -> Project (CTRL-SHIFT-N)
3) In the New Project window, select Web, then ASP.NET Core Application (.NET Core), give your project a name and click on OK.
4) In the next window, select the ASP.NET Core Version, highlight Web Application and click on the OK button.
5) Open the 'publish' settings in your project by right clicking on it in the Solution Explorer window and then selecting it.
6) Choose the 'IIS,FTP,etc' option and click 'Publish'
7)Validate the connection with our web deploy server and do not click 'save' button.
8)Go to 'next' or 'Settings' option then update the 'Deployment Mode' to 'Self-Contained' mode and update the 'Target Runtime' to 'win-x86'
Note: A Self-Contained ASP.NET Core application does require more memory to run because it is loading all the assemblies required by the version. You can reduce the memory usage by changing the garbage collection mode from server to workstation. Just add the <ServerGarbageCollection> XML markup to the ASPNETCore.csproj file and set it to "false".
<PropertyGroup>
<ServerGarbageCollection>false</ServerGarbageCollection>
</PropertyGroup>
Article ID: 1973, Created: June 22, 2018 at 3:09 AM, Modified: September 12, 2018 at 6:43 AM