-3

I want to run my Windows Form Application (Created Using With VS 2012 - Targeting .NET 3.5 - written in C#) on PCs that don't have .NET 3.5 installed on them.
There are many PCs out there for me to consider, and I can not do that.
So should I change my framework and I not rewrite that big project again?
Is there a way to convert the output exe file to another language that does not need .NET Framework?

JNYRanger
  • 6,829
  • 12
  • 53
  • 81
SilverLight
  • 19,668
  • 65
  • 192
  • 300
  • 3
    You can rewrite it without relying on .NET, or you can pay someone to rewrite it without using .NET .. that being said, you likely just want the executable (or setup) to automatically help the user install the required .NET framework. – user2864740 Jan 24 '14 at 00:58
  • 4
    Why not just provide the required framework? You could distribute it with your application - See: http://support.microsoft.com/kb/324733 – NoChance Jan 24 '14 at 01:01
  • http://stackoverflow.com/questions/10050160/packaging-a-net-application-so-it-will-run-on-a-computer-without-net – user2864740 Jan 24 '14 at 01:03
  • One big problem is it's not just your code that you'd need to convert. It's all the code from .Net that your application uses. It would be far simpler to install .Net. You could also try targeting .Net2.0. There can't be many Windows machines out there without .Net2.0 – StevieB Jan 24 '14 at 01:03
  • in windows 8 .net 2.0 was disabled | i don't know why do they do this crap? – SilverLight Jan 24 '14 at 01:07
  • the upgrade to 3.5 from 2.0 is cumulative; Make sure people understand there is no harm in installing 3.5 if the system already has the 2.0 – Luis Filipe Jan 24 '14 at 01:11
  • You can embed .NET in your installer so it's a non-issue. – JNYRanger Jan 24 '14 at 01:14
  • 2
    So many misconceptions, so little time. – Robert Harvey Jan 24 '14 at 01:15
  • 1
    Have you verified the size of your expected userbase running an OS incapable of running .NET 3.5? – CodeCaster Jan 24 '14 at 01:15
  • http://www.remotesoft.com/linker/ – hazzik Jan 24 '14 at 01:15
  • @RobertHarvey can you clarify? – Luis Filipe Jan 24 '14 at 01:28
  • @LuisFilipe: Where do I start? Read the premises in the question again, and the question that results from those premises. Read the comments in the answer below about compiling. – Robert Harvey Jan 24 '14 at 01:30

2 Answers2

1

There are tools that will package everything up into a single binary for you such as .net reactor http://www.eziriz.com/

pm100
  • 48,078
  • 23
  • 82
  • 145
  • did you see this "Our products are compatible with all .NET languages and supports all Operating Systems where .NET Framework or Mono can be installed." on http://www.eziriz.com/ -> i think we still need .net after protection! – SilverLight Jan 24 '14 at 01:11
  • i dont think so - it will package everything up for you – pm100 Jan 24 '14 at 01:17
  • what about http://www.red-gate.com/products/dotnet-development/smartassembly/? do we need .net after packing? – SilverLight Jan 24 '14 at 01:20
-1

You cannot compile C# .NET into native code. The only solution I see is to set the Project's Target Framework to .NET 2.0 which would allow you to XP and up no matter what.

AaronDancer
  • 649
  • 1
  • 7
  • 22
  • This is not strictly speaking true actually. You CAN compile to native code. It's just so clumsy that no one ever does it. – sircodesalot Jan 24 '14 at 01:09
  • @sircodesalot: That's pretty opinionated, and largely wrong. The more truthful answer is that you can compile it to native code using NGEN, but it still requires the .NET Framework. – Robert Harvey Jan 24 '14 at 01:13
  • ... right, you CAN, but it's clumsy (because it still requires .NET), and thus no one does it. – sircodesalot Jan 24 '14 at 01:15
  • Clumsy is as clumsy does. Saying that something is clumsy imparts no useful information. – Robert Harvey Jan 24 '14 at 01:15
  • besides what about windows 8? in win 8 we don't have .net 2.0 - should install from windows features? – SilverLight Jan 24 '14 at 01:16
  • @sircodesalot well if JIT Compiler is used I guess you could use ngen.exe to turn the IL into native. But that's not compiling, that's refactoring. Using JIT Compiler alone, you cannot compile into native code. Using another compiler, sure you can. – AaronDancer Jan 24 '14 at 01:17
  • More misconceptions. Where do I find the time to refute them all? – Robert Harvey Jan 24 '14 at 01:17
  • @MoonLight derp... I forgot Windows 8 doesn't include .NET 2.0-3.5. That's annoying... – AaronDancer Jan 24 '14 at 01:18
  • Those applications should still run just fine on .NET 4.0. [See here](http://msdn.microsoft.com/en-us/library/vstudio/ee941656(v=vs.100).aspx) for possible exceptions, but they are few. – Robert Harvey Jan 24 '14 at 01:20