Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to run a c# .exe without .net framework on a machine.
How can I run c# .exe without installing .net framework on the PC?

Thank you.
But may you explain how can I install .net framework with my application installation please? My exact concern is that when a user have installed the application , without any extra installation it work perfectly.
Posted
Updated 27-Mar-16 23:47pm
v3
Comments
J.Karthick 15-Feb-11 6:09am    
I don't think, it's possible...
Pravin Patil, Mumbai 15-Feb-11 6:24am    
It is not at all possible.

You can't.

C# does not compile to native code: it compiles to something called Intermediate Language which is executed by the Common Language Runtime (CLR).

Without the .NET framework, the program cannot, and will not run.

Note though that the .NET framework is installed with Vista and above anyway...


"Is the packing the assemblies that the project wants and put it in it's files possible?"


See here[^] - MSDN guide to deployment.
 
Share this answer
 
v3
Comments
mehdi_k 15-Feb-11 6:24am    
Is the packing the assemblies that the project wants and put it in it's files possible?
Pete O'Hanlon 3-Oct-13 5:45am    
Sorry to reopen an old answer Griff, but your answer is not correct. It is perfectly possible to run a C# application without the .NET framework installed. It's not a trivial endeavour to roll your own, but there used to be a product called thinstall that did this for you (it's now been acquired by VMware and is packaged as VMWare ThinApp).
OriginalGriff 15-Feb-11 6:30am    
Answer updated
OriginalGriff 3-Oct-13 6:52am    
No problem! I don't mind in the least being told when I'm wrong - better that than not told :laugh:

What are you doing looking at nearly 2 year old questions? Very bored today? :laugh:
Sergey Alexandrovich Kryukov 15-Feb-11 17:50pm    
Correct, my 5.
--SA
The most practical approach to take if you absolutely want to avoid dependencies on the .NET framework (and maybe also due to performance considerations) is to use C++. Visual C++ 2010 is probably one of the best versions of the C++ compiler to ever be released by Microsoft.
 
Share this answer
 
Comments
Espen Harlinn 16-Feb-11 15:05pm    
Good point, my 5
Griff is right, but I want to add two cents:

The better question is: "can I run the C# application without Windows?" The answer is "Yes, in many cases".

Are you sure you understand the role of .NET? As Window was historically a framework and run-time host on top of DOS, now it gradually happens to .NET. I really hope that Windows will die, but .NET will not. Even now I know several developing platforms based on pure .NET (more exactly, ECMA/ISO CLR specifications).
.NET is available on many OS in the form of standard-compliant Mono software (http://en.wikipedia.org/wiki/Mono_(software)[^]). I run my applications compiled on Windows (even with Forms) on my Linux machine without recompilation.

Practically, it's good not to afraid about having .NET installation, it becomes a common place and is bundled with newer versions of Windows. Even if it is not, the comprehensive solution is to deploy .NET re-distributable with the installation of application, which is not so hard to do.

Start from this: http://msdn.microsoft.com/en-us/library/6hbb4k3e.aspx[^], see also: http://www.netomatix.com/articles/KBArticle.aspx?a=324733[^].

Google: http://en.lmgtfy.com/?q=(deploy+OR+deployment+OR+distribute+OR+distributing)+.net+framework+with+application[^].

—SA
 
Share this answer
 
v2
Comments
JOAT-MON 15-Feb-11 21:51pm    
Your 2 cents is worth 5 here. :)
JF2015 16-Feb-11 0:25am    
Good 2 cents :)
mehdi_k 16-Feb-11 4:22am    
Thank you.
But may you explain how can I install .net framework with my application installation please?
My exact concern is that when a user have installed the application , without any extra installation it work perfectly.
Sergey Alexandrovich Kryukov 16-Feb-11 14:25pm    
Yes, please see two new references in my updated Answer.
--SA
johannesnestler 16-Feb-11 9:28am    
Have a look at the visual studio help about setup projects and oneclick deployment - it's very easy. VS takes care of the dependencies (correct .NET version). In about 5 clicks you have a finished setup for installing your app and all the dependencies (you can include them from your developer machine (redistribution) or the user can download it) - So open http://msdn.microsoft.com/en-us/library/t71a733d(v=vs.80).aspx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900