ClickOnce does not produce one single WPF app file

94 Views Asked by At

I published my WPF project following these steps

  1. Choose ClickOnce
  2. Choose output location
  3. Define version, etc.
  4. Choose Self-contained, produce single file

enter image description here

However, I still see Application Files in the output folder and if I delete it, the app doesn't work. I watched some tutorial on Youtube and see that if I publish the app this way, I don't need other files, as well as the users don't have to install .NET. But it doesn't seem to be the case. enter image description here

I even use command line (https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=cli) but the result was the same. When running the app on another pc, it still asks me to install .NET. Did I setup it wrong or the tutorial I saw was a success because they were simple projects and don't have many dependencies?

1

There are 1 best solutions below

1
mm8 On

I am afraid you cannot package a ClickOnce app into a single executable .exe file out of the box.

You need to choose between ClickOnce or single-file deployments - it's one or the other but not both. Or package the ClickOnce app into an archive or something yourself and then extract the archive before installning the app.