I have a .Net 4.0 application that I need to improve the performance of code running in a partial trust environment. Specifically, I would like to eliminate the need to JIT at runtime. Normally this is accomplished using NGEN (http://http://msdn.microsoft.com/en-us/library/6t9t5wcf(v=vs.100).aspx) but this doesn't work for assemblies running in partial trust. Do I have any other options?
Native images that are generated with Ngen.exe can no longer be loaded into
applications that are running in partial trust.