Deploy .NET Applications
- 2 minutes to read
Self-Contained Deployment
Use one of the following techniques to deploy your .NET application:
Framework-Dependent Deployment
The application does not include the targeted .NET version. You should install the targeted .NET version on the client machine.
Self-Contained Deployment
The target version of .NET is included in the application package. Note that you must pre-select target platforms, which increases the size of deployment packages.
You can deploy self-contained applications in Visual Studio or call the following command in the command-line interface:
dotnet publish -c Release -r win10-x64 --self-contained true
Read the following topic for additional information: .NET application publishing overview.
Single-File Deployment
You can publish .NET applications as an executable file. To do this, run the command prompt, navigate to the application folder, and call the following command:
dotnet publish -r win10-x64 -c Release -p:PublishSingleFile=true
Read the following blog post for additional information: WinForms - Single-File Applications with .NET.
Tip
To speed up .NET application startup, consider the following options:
- Compile assemblies in ReadyToRun (R2R) format: R2R is a form of ahead-of-time (AOT) compilation, similar to NGen in .NET Framework applications.
- Enable MultiCore JIT: This optimizes the translation of Microsoft Intermediate Language (MSIL) to machine code, similar to NGen. MultiCore JIT is generally less effective for startup optimization compared to NGen. Read the following post for additional information: 9 Tips to Reduce App Startup Time.