Does using --self-contained will install all the need runtime files for running the app in server 2019/2022Does using --self-contained will install all the need runtime files for running the app in server 2019/2022

Dani_S 5,581 Reputation points
2025-04-02T15:05:24.5033333+00:00

Hi,

I have Maui app in .NET 9.

Does using --self-contained will install all the need runtime files for running the app in server 2019/2022.

I installed the app ,deployed as exe with using -- self contianed.

dotnet publish -f net9.0-windows10.0.19041.0 -c Release -p:WindowsPackageType=None -p:WindowsAppSDKSelfContained=true /p:PackageCertificateThumbprint="c01ba45666762f3615cf6813aeb4dc4b1919541d" -p:RuntimeIdentifierOverride=win10-x64 --self-contained

Thanks,

Developer technologies | .NET | .NET Multi-platform App UI
0 comments No comments

Answer accepted by question author

Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 50,166 Reputation points Microsoft External Staff
2025-04-03T01:28:08.5333333+00:00

Hello,

Yes, you do not need to install the runtime in your environment when publishing using the --self-contained parameter.

Please refer to the original description in the dotnet publish.

--sc|--self-contained [true|false] Publishes the .NET runtime with your application so the runtime doesn't need to be installed on the target machine. Default is true if a runtime identifier is specified and the project is an executable project (not a library project). For more information, see .NET application publishing and Publish .NET apps with the .NET CLI. If this option is used without specifying true or false, the default is true. In that case, don't put the solution or project argument immediately after --self-contained, because true or false is expected in that position.

Best Regards,

Alec Liu.


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.