cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JoderCoder
Level 8

.Net Applications & ngen

I was asked to perform ngen.exe on the application after installing the binaries but this ngen process must be done as part of the installation. The purpose that I was told is that ngen will compile and generate processor binaries and save it so that the user will not experience the extra delay that would occur at the first ever run of the application.

Is there some designated InstallShield power for this? Or do I have to call ngen.exe somehow, in a Custom Action or so?

Thanks for pointers in advance.
Labels (1)
0 Kudos
(1) Reply
Christopher_Pai
Level 16

Make each assembly the keyfile of it's own component and then set the ".NET Precompile Assembly" component attribute to Yes.

As an aside, I usually question developers who ask for this if they have done profiling and are sure this is what they want. Many .NET developers don't truly understand NGEN and sometimes think it will be a magical cure all for upstream application design problems. It's also been known to break more then one install since your calling EXE (ngen) custom actions at install time.


One particular story comes to mind ( can't find the link ) is a Windows Update that dumped a bunch of assemblies then NGEN'd them with a high priority basically making the machines very sluggish for 30-60 minutes after applying the patch.

Good link on this subject is:

http://blogs.msdn.com/clrcodegeneration/archive/2007/09/15/to-ngen-or-not-to-ngen.aspx
0 Kudos