3

Im getting confused

one time and for all

the VS add reference (/net tab) says that dll's gac are here : enter image description here

And I found this folder which contains GAC : ( p.s. why 3 Gac's types ? ) enter image description here

And also this folder which contains GAC :

enter image description here

Can someone , please , fix my headache ?

Royi Namir
  • 144,742
  • 138
  • 468
  • 792
  • 1
    I want to extend the question: Let's say i have C:\DLL\MyGAC.dll. When i add it to GAC using gacutil, does it copies that DLL to any of these folders? And what DLL PATH i will see in add .NET reference window? – Alex Dn Apr 24 '12 at 13:27

3 Answers3

3

%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v4.0" folder contains those assemblies that ship with the .Net Framework which are useful for referencing during the design and build of new components. See http://blogs.msdn.com/b/msbuild/archive/2007/04/12/new-reference-assemblies-location.aspx. This is not at all a GAC.

There are two distinct GACs, one for CLR 2.0 and other for CLR 4.0. The one %windir%\assembly is used by CLR 2.0 (.Net 2.0 to 3.5) while %windir%\Microsoft.NET\assembly is used by the CLRs greater than 2.0 (currently 4.0 only).

Royi Namir
  • 144,742
  • 138
  • 468
  • 792
Faisal
  • 4,054
  • 6
  • 34
  • 55
3

After installing .NET 4 there are actually two GACs in your system, one for .NET version 2-3.5 and one for version 4. This is already explained here. Each of those directories has a number of subfolders which contain assembly images with code in x86, x64 and MSIL.

The "reference assemblies" directory inside Program Files is not a GAC.

To answer Alex Dn's comment as well: you should not care where the DLL goes once you install it in the GAC. The very purpose of gacutil is to hide this knowledge from you so that .NET doesn't go the familiar way of picking up dependencies from people who partially "reverse-engineer" how stuff works and then e.g. hardcode a path inside their application.

Community
  • 1
  • 1
Jon
  • 428,835
  • 81
  • 738
  • 806
  • can you please edit ,regarding the different folders versions please ? – Royi Namir Apr 25 '12 at 07:02
  • Also - still , According to Alex question - will it copy the File into those folders ? – Royi Namir Apr 25 '12 at 07:07
  • @RoyiNamir: Sure, but what do you mean edit re the different versions? – Jon Apr 25 '12 at 07:45
  • i meant if you can enhance your answer ( edit it) regarding to : different folders (gac , gac_32 , gac_msil) Also , According to Alex question - will it copy the File into those folders ? – – Royi Namir Apr 25 '12 at 07:51
0

I thinks it's in two paths for historic reasons.

They must have split the assemblies for each platform (such as MSIL, Native 32, Native 64, Embedded, ARM, ...)

So depending on how you compile your process you will link one or another deps. So between portable .net (only MSIL) and Managed C++ (only Native)...

But i'm not sure at all :)

ykatchou
  • 3,667
  • 1
  • 22
  • 27