Results 1 to 5 of 5

Thread: Single exe file

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    402

    Single exe file

    Is it possible to create a single Exe file for a project that contains everything that is needed for the project to run, including the dll’s and the .net framework files needed.

    If this is possible can some one advise how or point me in the right direction

  2. #2
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Single exe file

    Yes, you can deploy fully self-contained .Net applications in a single EXE.

    However, they must be .Net Core applications. The latest version of .Net Core is actually called .Net 6. Assuming Visual Studio 2022, go to the Build menu and select the Publish Selection in your .Net 6 project. There are various options there and among them are the options necessary for producing single EXE deployments.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  3. #3
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: Single exe file

    Quote Originally Posted by Signalman View Post
    Is it possible to create a single Exe file for a project that contains everything that is needed for the project to run, including the dll’s and the .net framework files needed.

    If this is possible can some one advise how or point me in the right direction
    Does it really has to be a monolithic executable or can you also work with the concept of a portable app?

  4. #4
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    710

    Re: Single exe file

    Quote Originally Posted by Niya View Post
    Yes, you can deploy fully self-contained .Net applications in a single EXE.

    However, they must be .Net Core applications. The latest version of .Net Core is actually called .Net 6. Assuming Visual Studio 2022, go to the Build menu and select the Publish Selection in your .Net 6 project. There are various options there and among them are the options necessary for producing single EXE deployments.
    Be aware that it's not really a single file - your code + the .NET code will be in a a single dll, the launcher for this will be an exe, and a few support dlls will be included.
    So you're actually going to have about half a dozen files, not one.

    Also, if it's WPF or WinForms, then you won't want the single-file option because this will prevent you from doing your own removal of unneeded assemblies. Trimming via dotnet publish is disabled now for WPF or WinForms, but you can remove unneeded assemblies if you choose "self-contained" but not "single file".
    David Anton
    Convert between VB, C#, C++, & Java
    www.tangiblesoftwaresolutions.com

  5. #5
    New Member RWirtz's Avatar
    Join Date
    Oct 2016
    Location
    Reno, NV and LA, CA
    Posts
    3

    Re: Single exe file

    I use this program to include my DLLs into the exe. Using this program, I only have to distribute one exe file.

    Here's the link:

    https://www.pelock.com/products/netshrink

    It's sort of a 'life saver' for me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width