views:

472

answers:

6

Is there any work being done to create a C# compiler to produce native exe's? e.g. the output is a native exe and NOT a .NET assembly.

+1  A: 

There is such solution for Mono, this is 'mkbundle' - static linking instead of using JIT/CLR/GAC, I guess

abatishchev
I guess you could also use ngen if you could jippo it...
Jonathan C Dickinson
+1  A: 

You'd still have to provide the libraries in some form so either you'd still have to have a runtime installed, or the native exe would have to be huge.

Douglas Leeder
The compiled exe size can be controlled by using split libs.
Gary Willoughby
+1  A: 

If you want a standalone deployment (i.e. without needing the framework), there are a few options - see here. However, I'm not aware of anything that will reliably produce purely unmanaged code. What is the use-case you have in mind? For embedded etc there is micro-framework, CF, etc.

Marc Gravell
No use-case, just interest.
Gary Willoughby
+1  A: 

.NET linker

You might find this interesting to read as well: .NET Internals and Native Compiling.

Note that for the reflection to work a lot of information about the code will always have to present.

Hrvoje Prgeša
+1  A: 

There are two active projects. They are geared toward CIL-based operating systems, but the current iteration of MOSA Compiler Framework runs on Windows (unit tests etc.) and has limited boot support. Cosmos used to have a Windows architecture and a few plugs, but they don't do Windows any more - only booting into a CIL environment.

Cosmos is much futher along however, they have pretty much nailed object support. MOSA is only bare-metal (static methods) for now - although it is done the 'proper' way and well unit-tested (and I think making faster progress). Give it a few more months and then go back and have a look.

Niether has a JIT at the moment (which doesn't matter since you don't want one). It is all compiled to machine code ahead of time.

Jonathan C Dickinson
+1  A: 

Why don't you try NGen. For exemple Paint.NET use nGen to create native images after installation.

TheVillageIdiot