Back to Devexpress

Deploy .NET Applications

wpf-401276-dotnet-core-support-deploy-netcore-application.md

latest2.2 KB
Original Source

Deploy .NET Applications

  • Feb 10, 2023
  • 2 minutes to read

.NET allows you to publish WPF applications in the following ways:

  • Framework-Dependent Executable

  • Self-Contained Deployment

Publish in Visual Studio

To publish an application, right-click the project file and select Publish.

Create a new publish profile, if you have not done so already:

To change the mode, click the Edit publish profile button:

In the Profile Settings window, select the Deployment Mode and click Save :

Click Publish to publish your app to the specified folder.

Publish in Command Line

console
# <RID> - Runtime Identifier: win-x86, win-x64, etc.
# Framework-dependent executable:
dotnet publish -c Release

# Self-contained deployment:
dotnet publish -c Release -r <RID> --self-contained true

Deployment Options

Single Executable

You can pack your application, its dependencies, and the .NET runtime (if included in deployment) into a single-file executable. This executable contains everything your app requires to run.

To publish your app as a single file, add the following options to your project file:

xml
<PropertyGroup>
  <RuntimeIdentifier>win10-x64</RuntimeIdentifier>
  <PublishSingleFile>true</PublishSingleFile>
</PropertyGroup>

ReadyToRun Images

.NET allows you to improve the application startup time by compiling your application to ReadyToRun (R2R) format.

R2R binaries contain native code similar to what the just-in-time (JIT) compiler produces. The native code is used to reduce the amount of work the JIT compiler needs to do as your application loads.

To publish an app in the R2R format, set the <PublishReadyToRun> option to true in your project file:

xml
<PropertyGroup>
  <PublishReadyToRun>true</PublishReadyToRun>
</PropertyGroup>

The R2R binaries are larger, because they contain both the native and Intermediate Language (IL) code.