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

╄→гoц情女王★ 提交于 2019-12-19 02:58:08

问题


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


回答1:


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.




回答2:


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




回答3:


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.




回答4:


I'm not sure but it sounds like you want the .NET framework (or the parts needed for your app) to be included in the installer, so that it is 100% standalone, yes? I know that ClickOnce apps can download .NET if it is not already installed, but that doesn't help if you are deploying to machines with limited or no network connectivity. AS my understanding, you are allowed to redistribute the framework with your app:

http://msdn.microsoft.com/en-us/library/xak0tsbd.aspx , but I have never done it myself.

EDIT: You're application's executable does not actually need to be installed with an installer (it will run if you just double-click on it), but if you are including other files (such as redistributable of .NET) then you probably would need some kind of installer.




回答5:


It is possible to package a .net application into a single executable file using a concept referred to as application virtualization. It's not the most practical thing in the world, but it is possible.

I wrote some more details about it in response to this post.



来源:https://stackoverflow.com/questions/2110704/can-net-application-be-converted-into-a-portable-app-i-e-single-exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!