Publishing WinUI 3 unpackaged desktop project project leads to Unable to load DLL 'Microsoft.WindowsAppRuntime.Bootstrap.dll'
#7587
Labels
Unable to load DLL 'Microsoft.WindowsAppRuntime.Bootstrap.dll'
#7587
Issue Description
When I add
/p:PublishProfile=x64Profile
to msbuild publish command, the .exe created does not open. On inspecting the windows event viewer, it reveals an exception was thrown trying to open the exe.This is specifically for a WinUI 3 unpackaged desktop project.
Steps to Reproduce
A copy of a sample project can be found here: https://github.com/DanJBower/PusblishMcve
I added 2 batch files to demonstrate the issue
The steps I followed to set up the project were:
Install the latest dotnet sdk preview, I'm using 6.0.300-preview.22204.3
Install Windows App SDK 1.1 Preview 2
Install the latest Microsoft Visual C++ Redistributable
In Visual Studio Installer, make sure you have the following selected on Visual Studio 2022
Main Page
Universal Windows Platform development
.NET Desktop Development
Desktop development with C++
Individual Components Page
Create a new C#
Blank App, Packaged (WinUI 3 in Desktop)
in Visual Studio 2022In the .csproj, add
Run the publish command
Running
creates an exe I can use, however, it is not self-contained so there are 100s of files
Expected Behavior
It should create a single .exe file that opens
Actual Behavior
When opening in
NotWorkingPusblished
I get the errorWhen opening in
NotWorkingPusblishedpublish
, I get the errorAnalysis
I'm afraid I don't know what the issue is. I also tried
dotnet publish
but that had different errors. msbuild#7452Versions & Configurations
msbuild -version: 17.2.0.20702
dotnet --version: 6.0.300-preview.22204.3
The text was updated successfully, but these errors were encountered: