How to compress all files into a single .exe

Ewerton Dutra 20 Reputation points
2023-09-28T00:58:22.72+00:00

Goodnight,

The C# program that I am generating has a lot of files

  • app1.exe.config
  • app1.exe.manifest
  • app1.pdb

And if I add something to the project even more, there will be a lot of DLL and also XML

  • Newtonsoft.Json.dll
  • Newtonsoft.Json.xml

Isn't there a simple way to compile everything into one .exe?

Att

Developer technologies | C#
{count} votes

Accepted answer
  1. Anonymous
    2023-09-28T09:38:21.04+00:00

    Hi @Ewerton Dutra , Welcome to Microsoft Q&A,

    You can check the documentation of Single-file. The official support is to this extent.

    Environment:Vs 2019 and above

    Project :.Net Core 3.1 and above

    Console Application:

    [enter image description here]

    1. Click Folder and Next:

    [enter image description here]

    1. Click Folder and Next:

    [enter image description here]

    1. Click Finish:

    [enter image description here]

    1. Show all settings->self-contained->win-x64->produce a single file:

    [enter image description here]

    1. That's the exe.

    [enter image description here]

    Best Regards,

    Jiale


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.