Core-to-Core: Converting a Framework-Dependent App to Self-Contained in Visual Studio 2017

Below are the steps on how to change a Framework-Dependent .NET Core application to a Self-Contained one for Visual Studio 2017.

-Start Visual Studio.
-Please open a new project by selecting File > New > Project
-In the New Project window,  select Web, then ASP.NET Core Application (.NET Core), give your project a name, and click on OK.
 
a
 
 
-In the next window, select the ASP.NET Core Version and highlight Web Application and click on the OK button.
 
 
- Open the 'Publish' settings in your project by right-clicking on it in the Solution Explorer window and then selecting it.
 
 
-Please click the 'IIS, FTP, etc' option and click the 'Publish' button.
 
 
- Validate the connection with our web deploy server and do not click the 'save' button
 
 
Then please click 'Next' or 'Settings' button to update the 'Deployment Mode' to 'Self-Contained' and 'Target Runtime' to 'win-x86'
 
8
 
 
Now, you can deploy your solution to the platform of your choice without the need for certain assemblies to be installed on the server to support a particular .NET Core version.
 
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 thegarbage 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>
 
 
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

SQL server- network related or instance-specific error happened while connection establishing

  Instance-specific or network related error happening while connecting to SQL server   Please...

OleDB connection string examples

OleDB connection string examples MS Access (Jet) "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA...

Do you allow custom COM components?

Do you allow custom COM components? We are not offering to install the custom COM components...

Error when accessing a WCF services

Error when accessing a WCF services Error when accessing a WCF service: "IIS specified...

How to cache static contents to client with UseMaxAge?

You can consider to caches static contents to the client with UseMaxAge if your website has too...