Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can .Net Application be converted into a Portable App i.e. single .exe

Can a .Net application be converted into a single .exe portable application?

i.e. no installer, it just runs?

I imagine all the dll's, resources etc need embedding into the exe? If so, how would I do this?

Thanks

like image 937
Belliez Avatar asked Jan 21 '10 16:01

Belliez


3 Answers

You could use ILMerge to merge all assemblies into a single executable. But you still need the framework runtime installed. To turn your executable into a native executable you may take a look at this question.

like image 145
Darin Dimitrov Avatar answered Oct 19 '22 17:10

Darin Dimitrov


No - you can't statically include the .net runtime in your own application

like image 1
Martin Beckett Avatar answered Oct 19 '22 16:10

Martin Beckett


Yes, a .NET application can be a single .exe file. You can either only write one assembly with no dependencies outside of the .NET framework, or you can combine multiple assemblies into one using ILMerge. The user will still need the appropriate version of the .NET framework installed, though; there's no way around that.

like image 1
Adam Robinson Avatar answered Oct 19 '22 16:10

Adam Robinson