-
Aug 2nd, 2022, 04:23 PM
#1
Thread Starter
Hyperactive Member
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
-
Aug 3rd, 2022, 07:45 AM
#2
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.
-
Aug 3rd, 2022, 08:04 AM
#3
Re: Single exe file
Originally Posted by Signalman
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?
-
Aug 3rd, 2022, 08:09 AM
#4
Re: Single exe file
Originally Posted by Niya
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".
-
Aug 18th, 2022, 03:39 PM
#5
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|