doc/articles/uno-publishing-desktop.md
net10.0-desktop target frameworkShow all settingsReleasenet10.0-desktopFramework-dependent or Self-contained
Self-contained is chosen and you're targeting Windows, Target runtime must match the installed .NET SDK runtime identifier
as cross-publishing self-contained WPF apps (e.g. win-x64 to win-arm64) is not supported for now.On Windows/macOS/Linux, open a terminal in your csproj folder and run:
dotnet publish -f net10.0-desktop
If you wish to do a self-contained publish, run the following instead:
dotnet publish -f net10.0-desktop -r {{RID}} -p:SelfContained=true -p:TargetFrameworks=net10.0-desktop
Where {{RID}} specifies the chosen OS and Architecture (e.g. win-x64). When targeting Windows, cross-publishing to architectures other than the currently running one is not supported.
[!IMPORTANT] Due to changes in the .NET SDK, when providing an
{{RID}}you will also need to add the following parameter-p:TargetFrameworks=net10.0-desktopfor the publish command to succeed.
Single file publishing is supported with the following parameters:
dotnet publish -f net10.0-desktop -r {{RID}} -p:SelfContained=true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:IncludeAllContentForSelfExtract=true
Same as above, make sure to replace the {{RID}} with a valid value.
The IncludeNativeLibrariesForSelfExtract and IncludeAllContentForSelfExtract properties can also be set in a PropertyGroup in the .csproj.
Uno Platform supports publishing desktop apps using ClickOnce to Windows environments.
To publish your app that targets net10.0-desktop in your .csproj, you'll need to create a .pubxml file using Visual Studio, or use the file below:
Create a file named Properties\PublishProfiles\ClickOnceProfile.pubxml in your project with the following contents:
<?xml version="1.0" encoding="utf-8"?>
<!-- https://go.microsoft.com/fwlink/?LinkID=208121. -->
<Project>
<PropertyGroup>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.*</ApplicationVersion>
<BootstrapperEnabled>True</BootstrapperEnabled>
<Configuration>Release</Configuration>
<CreateWebPageOnPublish>False</CreateWebPageOnPublish>
<GenerateManifests>true</GenerateManifests>
<Install>True</Install>
<InstallFrom>Disk</InstallFrom>
<IsRevisionIncremented>True</IsRevisionIncremented>
<IsWebBootstrapper>False</IsWebBootstrapper>
<MapFileExtensions>True</MapFileExtensions>
<OpenBrowserOnPublish>False</OpenBrowserOnPublish>
<Platform>x64</Platform>
<PublishProtocol>ClickOnce</PublishProtocol>
<PublishReadyToRun>False</PublishReadyToRun>
<PublishSingleFile>False</PublishSingleFile>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>True</SelfContained>
<SignatureAlgorithm>(none)</SignatureAlgorithm>
<SignManifests>False</SignManifests>
<SkipPublishVerification>false</SkipPublishVerification>
<TargetFramework>net10.0-desktop</TargetFramework>
<UpdateEnabled>False</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateRequired>False</UpdateRequired>
<WebPageFileName>Publish.html</WebPageFileName>
<!-- Those two lines below need to be removed when building using "UnoClickOncePublishDir" -->
<PublishDir>bin\Release\net10.0-desktop\win-x64\app.publish\</PublishDir>
<PublishUrl>bin\publish\</PublishUrl>
</PropertyGroup>
<ItemGroup>
<!-- This section needs to be adjusted based on the target framework -->
<BootstrapperPackage Include="Microsoft.NetCore.DesktopRuntime.10.0.x64">
<Install>true</Install>
<ProductName>.NET Desktop Runtime 10.0.1 (x64)</ProductName>
</BootstrapperPackage>
</ItemGroup>
</Project>
[!NOTE] An existing Visual Studio issue prevents the Publish context menu from being active if iOS/Android are present in the TargetFrameworks list. In order to create the file, you can temporarily remove those target frameworks from
TargetFrameworksin order to create the.pubxmlfile generated.
To use the Visual Studio publishing wizard:
netX.0-desktop target framework in the debugger drop-downThe Properties\PublishProfiles\ClickOnceProfile.pubxml file will be created.
Once done, you can use the following command in your CI environment, or using a Developer Command Prompt for Visual Studio:
msbuild /m /r /target:Publish /p:Configuration=Release /p:PublishProfile="Properties\PublishProfiles\ClickOnceProfile.pubxml" /p:TargetFramework=net10.0-desktop
The resulting package will be located in the bin\publish folder. You can change the output folder using /p:UnoClickOncePublishDir=your\output\directory.
Depending on your deployment settings, you can run the Setup.exe file to install the application on a machine.
[!IMPORTANT] At this time, publishing with the Visual Studio Publishing Wizard is not supported for multi-targeted projects. Using the command line above is required.