Search code examples
.netngen

Ngen without installer


I didn't use NGen before but now I need to improve startup performance of my WPF application. As I understand the common case is to run ngen during application installation. But my application is used for internal company needs and doesn't have installer (it would just complicate things).

Are there any other ways to run ngen? What if I do it when application is started for the first time? Will I need administrator rights for that?


Solution

  • According to MSDN (first line under Remarks), you'll need administrative privileges to run ngen. It would probably be easier to package your application in a simple MSI, because I don't think you can elevate your privileges from inside the application to run ngen. You would have to alter the manifest file which would cause your app to require administrative privileges every time it is started.