Where can I find location of generated file after doing Ngen?

后端 未结 5 640
感动是毒
感动是毒 2020-12-14 02:43

I did Ngen on a C# executable. It was succesful, but I cannot figure out where the generated file is in my PC. MSDN says it should be in native image cache, still not able t

5条回答
  •  庸人自扰
    2020-12-14 02:49

    The exact location will vary by version but it will be something similar to this:

    C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Web\ace3bede2f516f9e5bca620ad86cc063>System.Web.ni.dll
    

    They start in C:\Windows\assembly and then there is a subfolder NativeImages_vXXX for each .NET version. Then there is a subfolder for each dll that has a native image. Under that another subfolder for a unique version identifier (so you can have multiple native images from different versions of the same dll). Finally the native dll itself.

    Note that you cannot navigate to this directory in Windows Exlporer. Use cmd. In Explorer there is a shell extension that hides the details of how the GAC and native images work and just shows you a prettier UI.

提交回复
热议问题