Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bundle .NET dlls to run application in .NET-less machine?

AFAIK, ngen turns MSIL into native code (also reffered to as pre-JIT), however I never payed too much attention at it's startup performance impact. Ngen'd applications still require the .NET base class libraries (the runtime).

Since the base class libraries have everything our .NET assemblies need (correct?) would it be possible to ship the framework's DLLs with my ngen'd application so that it does not require the runtime to be installed? (e.g., the scenario for most Windows XP machines)

Oh, and please don't bother mentioning Remotesoft's Salamander Linker or Xenocode's Postbuild. They are not for my (and many's) current budget (and they seem to simply bundle the framework in a virtualized enviroinment, which means big download sizes and slow startup times I believe)

EDIT:
I know now, ngen doesn't do what I thought it did.
But is it possible to bundle the .NET files with an application, without using a VM?

like image 304
Camilo Martin Avatar asked Mar 16 '10 11:03

Camilo Martin


People also ask

What must be installed on a client computer to run NET based applications?

. Net framework is required for machines hosting ASP.Net application. Client only gets HTML/Javascript/CSS, Stuff which client's browser can handle. No server side code is executed on client.

Does .NET 4.8 include 4.7 2?

if you have 4.8 then you have 4.7. 2 automatically.


2 Answers

You cannot do this. Many essential components such as the garbage collector are part of the CLR (which is part of the framework runtime), so in order to successfully execute your application you need the framework installed.

like image 89
Darin Dimitrov Avatar answered Oct 06 '22 06:10

Darin Dimitrov


Have a look at Microsoft .NET Native:

.NET Native compiles C# to native machine code that performs like C++. You will continue to benefit from the productivity and familiarity of the .NET Framework with the great performance of native code.

It will be integrated in Visual Studio 2014.

like image 21
Saeb Amini Avatar answered Oct 06 '22 04:10

Saeb Amini