WPF Application as Portable Exe or Single Exe file

.net, deployment, wpf

Solution

Just publish your app and to create a single exe file:

- Right click your Startup project and select "Publish".

- On the publish view, unfold the "File publish options" and select "Produce a single file".

This will produce a single exe but will still be dependant on having Runtime of .Net Core on the client (Can be downloaded from here: .Net downloads page).

If you want it fully non dependant, you can select on "Deployment mode" dropdown "Self contained". This option will add ~150MB on your .exe file but the client doesn't need the .Net Core anymore as far as I know.

In such case I'm unaware of XP compatibility as .Net Core is supported from Win7 forward. I would appreciate any info about that if anyone tests it.

Furthermore, I have not tested this with Resources or any other kind of dependencies other than dll files.

Tested on Visual Studio Community 2019, project created as "WPF App (.Net Core)" and having as a dependency a project created as "Class library (.Net Standard)"

Problem

We developed an application based on WPF. We are able to successfully deploy an application using installer. Is there any way can we avoid the installation? Is it possible to use the application as Single Executable file without installation?

Original source

Related problems