Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run nGen at the end of the installation (MSI)?

I would like to execute nGen at the end of my installation simply to improve the perceived performance of the first startup of my application. How could I do that? Is there are some best practices? Can I be sure that nGen is always installed with .NET Framework?

Thanks!

like image 494
Martin Avatar asked Feb 06 '09 21:02

Martin


2 Answers

You can ngen your assembly using a custom installer action. The following link explains this in further detail:

http://www.dotnetperls.com/ngen

I can also remember a good discussion of Paint.NET's installer (which includes .NET Framework bootstrapping, pre-JITting etc.), but I cannot find it at the moment. I'll edit this post if I come across it again.

like image 71
Dave R. Avatar answered Oct 24 '22 09:10

Dave R.


First of all "Yes" you can guarantee that if they have the .Net framework installed that they have Ngen. The only thing you need to know is which version they have installed, buecause it's different between 1.1, and 2.0. What I've done in the past is simply created a script that my installer calls at the very end which runs ngen on all the assemblies.

like image 1
Micah Avatar answered Oct 24 '22 09:10

Micah