When you're publishing a .NET application as self-contained, ensure that the SelfContained
property is set to true
in your project file.
To publish a self-contained single executable, run the following command:
dotnet publish -c Release -r win-x64 --self-contained -p:PublishSingleFile=true