Publishing a Self-Contained App
Learn about the steps to publish a self-contained .NET application, including building and publishing for different operating systems.
We'll cover the following...
We'll cover the following...
Steps to publish a self-contained app
We have seen some example dotnet tool commands. We can publish our cross-platform console app:
Step 1: At the command line, ensure we are in the DotNetEverywhere
folder.
Step 2: Enter a command to build and publish the self-contained release version of the console application for Windows 10, as shown in the following command:
Press + to interact
dotnet publish -c Release -r win10-x64 --self-contained
Step 3: Note that the build engine restores any needed packages, compiles the project source code into an assembly DLL, and creates a publish folder, as shown in the following output:
MSBuild version 17.7.1+971bf70db for .NETDetermining projects to restore...All projects are up-to-date for restore.DotNetEverywhere -> /usercode/DotNetEverywhere/bin/Release/net7.0/win10-x64/DotNetEverywhere.dllDotNetEverywhere -> /usercode/DotNetEverywhere/bin/Release/net7.0/win10-x64/publish/
...