Maui app as exe - throw exception when installing on new machine

Dani_S 4,461 Reputation points
2025-03-24T08:37:27.1566667+00:00

Hi,

Maui app as exe - throw exception when installing on new machine.

This the message I got:

User's image

What do we miss ?

I used following command to publish application to exe.



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


I'm using vs 2022 professional Version 17.13.0

maui 9.0.30

And get following error.

enter image description here

I tested on new window 10:Windows 10 Enterprise 20H2 and it works, without .NET desktop runtime 9

Thanks,

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
4,083 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Mike Irving 0 Reputation points MVP
    2025-03-26T17:14:28.0533333+00:00

    A third party machine will need to have the same version .NET Runtime and any dependencies installed there.

    or you can choose to compile down to a ‘self contained’ application, with bundled runtime.

    see:

    https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-self-contained


Your answer

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