I get this error message when I try to start my WinUI 3 apps from Visual Studio:
But I already installed the newest .net v8.0.8. I also tried to install the specified v8.0.0 version but it did not help either. The installed runtimes on my PC:
My apps are WindowsAppSDKSelfContained with the following settings in the .csproj file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseRidGraph>true</UseRidGraph>
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
<WindowsPackageType>None</WindowsPackageType>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
</PropertyGroup>
But interestingly when I start the .exe from the output folder it runs perfectly without this issue for one winui3 app but the other app has the same issue even when started from the .exe file. Both have the same settings in the .csproj files.


Microsoft.WindowsAppSDKyou're using?<SelfContained>true </SelfContained>tag in the .csproj then the issue is gone. But I do not plan to use this option because I want the users to install the runtime I do not want to deliver it.