none
GAC Locations RRS feed

  • Question

  • Hi,

    I know that the .NET 4.0 GAC stores its assemblies at C:\Windows\Microsoft.NET\assembly and the .NET GAC pre-4.0 assemblies are at: C:\Windows\assembly.  The .NET 4.0 GAC is broken down into subdirectories:

    C:\Windows\Microsoft.NET\assembly>dir
     Volume in drive C has no label.
     Volume Serial Number is 108E-C26D

     Directory of C:\Windows\Microsoft.NET\assembly

    09/12/2012  01:31 PM    <DIR>          .
    09/12/2012  01:31 PM    <DIR>          ..
    09/12/2012  01:54 PM    <DIR>          GAC_32
    09/12/2012  01:54 PM    <DIR>          GAC_64
    09/12/2012  01:35 PM    <DIR>          GAC_MSIL

    GAC_32 (for 32-bit compiled assemblies)
    GAC_64 (for 64-bit compiled assemblies)
    GAC_MSIL (for assemblies compiled as "any cpu")

    The earlier .NET GAC has these three subdirectories, plus one called just plain GAC i.e. C:\Windows\assembly\GAC:

    C:\Windows\assembly>dir
     Volume in drive C has no label.
     Volume Serial Number is 108E-C26D

     Directory of C:\Windows\assembly

    09/12/2012  02:06 PM    <DIR>          GAC
    09/12/2012  01:54 PM    <DIR>          GAC_32
    09/12/2012  01:54 PM    <DIR>          GAC_64
    09/12/2012  02:06 PM    <DIR>          GAC_MSIL
    09/12/2012  02:42 PM    <DIR>          NativeImages_v2.0.50727_32
    09/12/2012  01:48 PM    <DIR>          NativeImages_v2.0.50727_64
    09/12/2012  02:42 PM    <DIR>          NativeImages_v4.0.30319_32
    09/12/2012  01:48 PM    <DIR>          NativeImages_v4.0.30319_64
    09/12/2012  02:42 PM    <DIR>          temp
    09/12/2012  02:05 PM    <DIR>          tmp

    What's that for, stuff that's not compiled as 32, 64, or "Any CPU"?  What are these Native Images ones for, COM interop?  I had a third-party .NET 3.5 assembly (that I was told was compiled as "any cpu") that was registered in the GAC.  I assumed it would be in c:\windows\assembly\GAC_MSIL, but it was at c:\windows\assembly\GAC.

    -Charlie

    • Moved by Barry Wang Monday, September 17, 2012 7:29 AM CLR related (From:.NET Framework Setup)
    Friday, September 14, 2012 6:16 PM

Answers

  • Hi Charlie,

    Welcome to the MSDN Forum.

    >>What's that for, C:\Windows\assembly\GAC

    As you have mentioned, GAC_32 is for 32bit platform, and 64 is for 64bit platform, and when you don't don't specify the platform, generally, the default platform is "any CPU" during your development. And there is one more situation: the assemblies don't have any platform, even "Any CPU", and such assemblies will be put in GAC folder: http://blogs.msdn.com/b/junfeng/archive/2004/09/12/228635.aspx  

    >>What are these Native Images 

    This is native code based on this specific platform(the net framework installed on). 

    Any .net code will be complied to native code which executes on the local processor. CLR can call such native code without compiling such public part again: http://msdn.microsoft.com/en-us/library/6t9t5wcf(v=vs.110).aspx 

    Ngen.exe creates native images, which are files containing compiled processor-specific machine code, and installs them into the native image cache on the local computer. The runtime can use native images from the cache instead of using the just-in-time (JIT) compiler to compile the original assembly.

    And more, the temp and tmp folder: http://blogs.msdn.com/b/junfeng/archive/2006/11/17/gac-temp-and-tmp.aspx 

    I hope these are helpful.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, September 17, 2012 8:40 AM
    Moderator