0

I searched in the last couple of days for a way to package my whole application (VS project) into a single .exe file. This project has a zip folder as a resource, what I want to achieve is this:

  1. Build an .exe file including all dependencies (7zip, .NET, zip folder resource, etc)
  2. Send the .exe file to a remote customer
  3. Once the customer runs the .exe, the zip file should be put in the path I decided upon in my project.

I could not understand how to do it. I saw multiple answers about running the Publish option but it does not work nor do I have the options they are suggesting.

See here Publish with VS 2017

Gilad Dahan
  • 508
  • 5
  • 19
  • What version of .Net does your project target. This might be a .NET (Core) thing and not work with .NET Framework. – phuzi Nov 03 '22 at 10:37
  • Not sure how to check but if I run dotnet --version from my project folder I get 2.1.520 – Gilad Dahan Nov 03 '22 at 10:44
  • @GiladDahan That's very outdated. Self-Contained publishing has been significantly improved with .NET 5.0. (Note that that alone won't give you a single exe file, though) – PMF Nov 03 '22 at 11:10
  • So what should I do to get what I need? – Gilad Dahan Nov 03 '22 at 11:14
  • Try this method and see if it works:https://learn.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-packaging-dot-net – Hao Yu-MSFT Nov 04 '22 at 07:05

1 Answers1

0

I ended up using ILMerge to pack my exe with other dlls

https://github.com/dotnet/ILMerge

The script at the end helped me create an automated process for this

Gilad Dahan
  • 508
  • 5
  • 19