Why are the .NET Framework 4.0 not added to the GAC?

I noticed something strange regarding the location of the .NET DLL. I tried to debug the problem with System.ServiceModel.dll, and I noticed that although I have .NET 4.0 installed, only version 3.0 of the ServiceModel DLL is installed in my GAC (I checked by examining C: \ Windows \ installation). However, if I go to "C: \ Program Files \ Reference Assemblies \ Microsoft \ Framework.NETFramework \ v4.0 \ Profile \ Client", then version 4.0 sits there. So why doesn't .NET install version 4.0 in the GAC?

And given that this is not the case, my 4.0 programs know where to find the 4.0 DLL versions? Is the path to the file I gave above checked automatically? I looked back at my application that uses DLL 4.0 to confirm that it does NOT copy the DLL locally, so it seems like it should get it from the GAC (and now I know that the DLL is not there) or probing in the .NETFramework folder. It really confused me ...

Edit: I followed the advice of MystereMan and ran "Gacutil.exe / l System.ServiceModel", but it still only shows version 3.0. Does this mean that .NET 4 did NOT install the DLL in the GAC?

Change # 2 and resolution: gacutil.exe in my PATH is an older version that cannot see build 4.0. When searching on my computer, I found gacutil.exe 4.0: C: \ Program Files \ Microsoft SDK \ Windows \ v7.0A \ bin \ NETFX 4.0. Using this, I was finally able to see a list of 4.0 System.ServiceModel.dll. Thank you all for your help!

Thanks,

-Robert

+6
source share
1 answer

.Net 4.0 uses a different GAC on Windows\Microsoft.Net\assembly .

Files in Reference Assemblies are empty stubs that are used only to filter IntelliSense in Visual Studio for different target frameworks.
If you open them in ILSpy, you will see that all methods are empty.

+3
source

Source: https://habr.com/ru/post/917224/


All Articles