views:

511

answers:

4

After seeing a previous post "Making Applications programmed in .NET languages work on older machines", I've got to wonder;

Are there tools to compile CIL to a binary?

If so, you could convert a CIL file to a native Windows app if you didn't want the user to require the .NET framework? Or even target the linux platform from .NET! That would be awesome!

A: 

Lego.NET can create native binaries, but it's still fairly limited.

Martin v. Löwis
A: 

There are tools to do it, but they basically package the entire .NET framework with your binary, which as you can imagine, causes considerable bloat.

Requiring people to have .NET installed isn't much of an ask these days. MS even provides an MSI package you can include into your own installer so that it's an option when they install your program.

Nick Johnson
+2  A: 

MS provides a free utility called NGEN that creates a native Windows executable from your .NET assembly.

But be aware that the CLR still requires your assembly to be available for fallback in case of native image invalidation, which can happen for a number of reasons. And also NGEN doesn't remove the necessity for your end-user to have the .NET Framework installed. Finally, NGEN can change the performance profile of your app, not always for the better.

There are utilities such as VMWare ThinApp (formerly Thinstall) that will create a native binary that includes your app and the relevant parts of the .NET Framework. This may be what you're looking for.

RoadWarrior