0

Possible Duplicate:
Can you compile C# without using the .Net framework?

im sure it's a common question. I did read about it but I don't know how to actually do it. I did see an answer over here that to remove system.dll and another reference, but I can't because I use them, so I read that I can include the Framework in my program or something like that. but how?

Thanks!

Edit: I mean to run after I compiled, sorry, my mistake

Community
  • 1
  • 1
MasterMastic
  • 20,711
  • 12
  • 68
  • 90
  • For what reason you want to do that? – FIre Panda Jul 12 '11 at 19:29
  • Is what you are asking "How do I package a C# application so it can be deployed on a machine that does not have a .Net framework installed?" Also, what kind of machines are you imagining to be the target of this? – antlersoft Jul 12 '11 at 19:30
  • 1
    Voting to close as "compile" is usually means "to transform source in a language into some sort of executable". Since C# have public standard for the language there is no technical problem to compile it withouth ANY framework. But I don't think it is what Ken wants to do. – Alexei Levenkov Jul 12 '11 at 20:27
  • @SLaks and @antelrsoft Yes. I mean to run and to package. I just have programs that I can't just give to friends of mine that we're working on a project because they need to get Framework 4, and they have a problem with it so they remove what they have and than download 4 and than download 2 because of some problems and... well, you see how messy it is. – MasterMastic Jul 12 '11 at 20:49

2 Answers2

1

I'm afraid that you cannot compile a C# program without the .NET Framework (or equivalent such as Mono) it was written for. There are some ways you can run a program without the framework, but not compile.

TRayburn
  • 1,535
  • 12
  • 10
1
  1. I would say, no by my opinion. You need "something" that compiles your code into binary. Will be this .NET Framework, Mono, MyOwnVeryCool framework, you have to have some dependency. If you think about .NET platform you need to compile to IL, so you have a dependecy from CLR, if you don't want compile to IL, so it's not more .NET platform.

  2. Consider the fact also, that on latest Windows OS its already shipped "builtin".

Regards.

Ben Robinson
  • 21,601
  • 5
  • 62
  • 79
Tigran
  • 61,654
  • 8
  • 86
  • 123