ngen

Invoke ngen from NSIS installer

I am using NSIS to deploy a .Net application. The installation/uninstallation process works fine, but I would like to add a final ngen step to improve startup performance. Unfortunately, Google didn't reveal any relevant material. It's unlikely that noone has ever done this before - maybe someone here has some idea? In the unlikely cas...

Very slow startup of ASP.NET applications

I have an ASP.NET applications with quite small number of pages. The problem I see is that the startup time is quite slow. As far as I can tell, most of the time is spent in JIT. Pre-compiling the applications seem not very helpful in reducing the #methods JIT as reported thru PerfMon. Does anybody know what I can do to reduce the startu...

Any reason why NGEN should hang and never complete for a particular assembly?

I have a class library project for .NET 3.5 built with Visual Studio 2008. If I try to NGEN the core assembly in this solution file, NGEN never completes, or at least not in the time I've bothered to let it run (like overnight). Has anyone else experienced this? And if so, did you solve it? And if you did, how? What steps did you take?...

How to measure the effect of correctly rebasing .NET assemblies before NGen?

Our application has a lot of .NET assemblies, which up until now, has not been deployed with NGen-scripts, so they are always JITted at runtime. Since our application is typically deployed to a terminal server, getting Windows to share binary images of the code is probably more optimal than the current way, so I'm looking at setting bas...

VS2010 profiler seems to not resolve symbols from ngen'd images

I'm profiling a Windows service by attaching to it in the 'sampling' mode. I open the results file, the "functions" view and I see the "hottest" function being displayed as [System.Runtime.Serialization.ni.dll] without indication of the concrete .net function inside this assembly. It looks like all other symbols from ngen'd assemblies...

Is ngen used to compile .NET code into an binary that will not require .NET framework to be installed when running the code?

I read the following paragraph on Wikipedia article about the CLR: Alternatively, the CIL code can be compiled to native code in a separate step prior to runtime by using the Native Image Generator (NGEN). This speeds up all later runs of the software as the CIL-to-native compilation is no longer necessary. Does this me...

Does NGEN'ing a .NET application help protect it from reverse engineering? If not when would I use it?

If Ngen doesn't protect my application, when would I reasonably expect to use this application in my career? ...

How do I prevent NGEN from rebasing my code (negatively affecting performance)?

I simply want to speed up my .NET-base client side app and am considering NGEN-ing the code. Jeffery Richter wrote this warning about ngening code: •Inferior Load-Time Performance (Rebasing). When Windows loads an NGend file, it checks to see if the file loads at its preferred base address. If the file cant load at its pre...