0

Im playing around with Winui3 for my next app. I created a default project from the Blank app, Packaged (winui3 in desktop) template in visual studio 2022.

When i run the application inside visual studio with the play button, it works. I want to now generate a stand alone .exe file to run the application. To do this i created a self-contained application through the publish option in visual studio that output the following three files: myapp.pri, myapp.exe and myapp.pdb.

But.. when i double click that published myapp.exe file, nothing happens. Just a spinning icon next to my cursor and nothing. No error.

When i first tried publish, it gave me an error. A google told me to edit the .csproj visual studio file and ammend the runtimeidentifier property and drop off the -10 tags on the end of them, which i did. that fixed the publish errors. Apart from this, i have not done anything.

*target framework is .NET 8.0, windows, target OS version 10.0.19041.0, releae, x64.

What am i missing?

1

1 Answer 1

1

Some tips about publishing a single file:

  • Make your app self-contained and unpackaged:
<PropertyGroup>
  <WindowsPackageType>None</WindowsPackageType>
  <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
</PropertyGroup>
  • Make sure your Profile Settings are correct for your environment:

Profile settings dialog

  • Remove the obj folder and the bin folder before publishing. I've seen reports mentioning that this works...
2
  • Thanks, I did this and it does not run the application when I publish. But its not a single self contained file. There are all sorts of DLL.s in the publish folder, and when i move my app.exe outside of that folder on its own and try to run it, it doesnt work.
    – Toby
    Commented Jul 12 at 10:13
  • If your app is not self-contained, you need to install the runtime for the WinAppSDK version. Commented Jul 12 at 14:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.