Skip to content

Commit

Permalink
Merge pull request #19447 from unoplatform/dev/jela/desktop-publish
Browse files Browse the repository at this point in the history
docs: Adjust desktop publishing
  • Loading branch information
jeromelaban authored Feb 18, 2025
2 parents 92e9da5 + 0af2e48 commit e0d4ae8
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions doc/articles/uno-publishing-desktop.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ uid: uno.publishing.desktop

## Publish Using Visual Studio 2022

- In the debugger toolbar drop-down, select the `net8.0-desktop` target framework
- In the debugger toolbar drop-down, select the `net9.0-desktop` target framework
- Once the project has reloaded, right-click on the project and select **Publish**
- Select the **Folder** target for your publication then click **Next**
- Select the **Folder** target again then **Next**
- Choose an output folder then click **Finish**
- The profile is created, you can now **Close** the dialog
- In the opened editor, click `Show all settings`
- Set **Configuration** to `Release`
- Set **Target framework** to `net8.0-desktop`
- Set **Target framework** to `net9.0-desktop`
- You can set **Deployment mode** to either `Framework-dependent` or `Self-contained`
- If `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.
Expand All @@ -34,17 +34,20 @@ uid: uno.publishing.desktop
On Windows/macOS/Linux, open a terminal in your `csproj` folder and run:

```shell
dotnet publish -f net8.0-desktop
dotnet publish -f net9.0-desktop
```

If you wish to do a self-contained publish, run the following instead:

```shell
dotnet publish -f net8.0-desktop -r {{RID}} -p:SelfContained=true
dotnet publish -f net9.0-desktop -r {{RID}} -p:SelfContained=true
```

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.

> [!NOTE]
> When building under Linux or macOS, you may need to add the following parameter `-p:TargetFrameworks=net9.0-desktop` for the publish command to succeed.
### Windows ClickOnce

Uno Platform supports publishing desktop apps using ClickOnce to Windows environments.
Expand Down Expand Up @@ -81,14 +84,14 @@ Create a file named `Properties\PublishProfiles\ClickOnceProfile.pubxml` in your
<SignatureAlgorithm>(none)</SignatureAlgorithm>
<SignManifests>False</SignManifests>
<SkipPublishVerification>false</SkipPublishVerification>
<TargetFramework>net8.0-desktop</TargetFramework>
<TargetFramework>net9.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\net8.0-desktop\win-x64\app.publish\</PublishDir>
<PublishDir>bin\Release\net9.0-desktop\win-x64\app.publish\</PublishDir>
<PublishUrl>bin\publish\</PublishUrl>
</PropertyGroup>
<ItemGroup>
Expand Down Expand Up @@ -126,7 +129,7 @@ The `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**:

```shell
msbuild /m /r /target:Publish /p:Configuration=Release /p:PublishProfile="Properties\PublishProfiles\ClickOnceProfile.pubxml" /p:TargetFramework=net8.0-desktop
msbuild /m /r /target:Publish /p:Configuration=Release /p:PublishProfile="Properties\PublishProfiles\ClickOnceProfile.pubxml" /p:TargetFramework=net9.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`.
Expand Down

0 comments on commit e0d4ae8

Please sign in to comment.