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 first.
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)
Asked
Active
Viewed 2,145 times
1

leppie
- 115,091
- 17
- 196
- 297

Ehsan Khodarahmi
- 4,772
- 10
- 60
- 87
-
possible duplicate of [Is there some way to compile a .NET application to native code?](http://stackoverflow.com/questions/45702/is-there-some-way-to-compile-a-net-application-to-native-code) – Darin Dimitrov Apr 03 '11 at 16:39
-
1Even if it was technically possible (say virtualizing registry and disks, and I don't even mention the support issues...), the license prevents you from redistributing the required .NET assemblies. They *must* be installed by Microsoft's official setup. – Simon Mourier Apr 03 '11 at 16:45
-
Is the issue installing the .NET framework, or upgrading it? Most versions of XP after SP2 had .NET installed, and all later ones have it as a base package. If its simply a matter of upgrading it why not use click-once to handle the package determination? – GrayWizardx Apr 03 '11 at 16:49
-
Better try to embed Microsoft's .NET framework installer into your setup. IMHO an up-to-date .NET framework version should be pre-installed on every Windows box. – Doc Brown Apr 03 '11 at 16:51
2 Answers
1
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.

CodesInChaos
- 106,488
- 23
- 218
- 262
0
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.

Vitaly Filatenko
- 415
- 3
- 12