Am I running as a native image?
-
I have several assemblies that have been registered for COM Interop but have not been installed into the GAC. There are all installed side-by-side in my application directory. One of the assemblies is a Windows Service exe. Things have been working fine but occasionally the service fails to start. I was wondering if this was due to the long startup time caused by the JIT compliation. I have now tried using Ngen to pre-compile all the assemblies. I see that they now appear in the GAC and have a cache type of ZAP? My question is - can I tell programmically if I'm using the native images I've just created? If not, can I verify that application is using the native images? How does the runtime find the native images? Especially the service which is configured to point at the original exe?
-
I have several assemblies that have been registered for COM Interop but have not been installed into the GAC. There are all installed side-by-side in my application directory. One of the assemblies is a Windows Service exe. Things have been working fine but occasionally the service fails to start. I was wondering if this was due to the long startup time caused by the JIT compliation. I have now tried using Ngen to pre-compile all the assemblies. I see that they now appear in the GAC and have a cache type of ZAP? My question is - can I tell programmically if I'm using the native images I've just created? If not, can I verify that application is using the native images? How does the runtime find the native images? Especially the service which is configured to point at the original exe?
solidstore wrote: I was wondering if this was due to the long startup time caused by the JIT compliation May be. solidstore wrote: have now tried using Ngen to pre-compile all the assemblies You have pre-jitted one or more assemblies so the resulting images are stored in the GAC for future reference. Without pre-jit, assemblies are jitted on-the-fly in memory. solidstore wrote: My question is - can I tell programmically if I'm using the native images I've just created? This question sounds weird. You are always using native images, whether they are from the GAC, or from in-memory jitted images. What's more interesting to the issue is what is the relationship between an assembly in a private folder referrenced by a main assembly, with the same assembly stored in the GAC : in other words, which assembly is used ? The answer is it has a lot to do with versioning rules and strong names. My recommendation is to read Jeffrey Richter's "Applied .NET framework programming" book. It's all there.