开发者

How to convert a .NET exe to windows binary which does not require .NET Framework for running?

开发者 https://www.devze.com 2023-02-21 23:09 出处:网络
I\'ve an exe file which is compiled under visual studio 2010(It\'s source project is a Windows Form Application with C#).

I've an exe file which is compiled under visual studio 2010(It's source project is a Windows Form Application with C#).

I must embed this exe in a installsheild msi setup file & it may be installed on any windows operating system(XP and later versions are supported). but for running my exe, end-users have to install Microsoft .net framework 4 on their systems at fir开发者_运维技巧st. I'm looking for a solution to convert my .NET native exe to a .NET-FREE exe which can be executed without having .NET Framework installed.

Is there any way to do this? (I mean a way EXPECT mono-project)


Mono supports ahead of time compilation, at least on some platforms. You might also be able to deploy mono with your program. But I'm not sure if Mono supports WinForms on windows.

I don't think Microsoft's .net implementation supports such a kind of deployment, so you're out of luck.


You can't create .NET-free application, but you can try to decrease .NET version requirements as much as you can by using ILMerge utility. For example I was successfully used it to decrease a 3d-party tool requirements from .NET 4.5 to 4.0.

The tool has much parameters, but usually all what do you need is the following:

ILMerge.exe /v4 /useFullPublicKeyForReferences /out:target.exe source.exe sourceLib1.dll sourceLib2.dll

Now sure whether it is your question, but it may help in some cases.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号