NGen

  • Thread starter Thread starter JMMB
  • Start date Start date
J

JMMB

Just a confirmation.
NGen generates native code when i install the windows application on the
client or when I run it for the first time?
thanks,
 
Actually neither, you have to manually run the ngen tool, or do it
explicitly in your deployment setup

Cheers
Benny
 
Actually neither, you have to manually run the ngen tool, or do it
explicitly in your deployment setup

Correct...

NGen has to be invoked manually on your assembly. When you do so
(ngen.exe myAssembly.exe) you can consider this action as running a
full JIT compilation (only JIT here means "now") on that assembly and
giving the result (native code).

However... It is advisable not to distribute assemblies that have
been ngen'ed on _your_ computer, since ngen will apply optimizations
for the computer it is currently running on... Unless you can ngen an
assembly to the target platform, do not ngen assemlbies that will be
distributed :)
 
Back
Top