Avatar of HLRosenberger
HLRosenbergerFlag for United States of America

asked on 

GAC, Windows Assembly

Can someone clear up something for me.  What is the difference between the GAC and the c:\windows\assembly folder?   I thought I read they were one in the same.  

However, I've being trying to add a DLL to the GAC.  I created an MSI setup for my DLL.  This DLL in turn has a dependency on a third party DLL.  When I run the install, I see the  third party DLL in c:\windows\assembly.  However I do not see my DLL.   So, I tried using the GACUTIL from the command line to install my DLL to the GAC.  That worked.   I can list back my GAC entry using  GACUTIL.  I can also list the third party DLL using GACUTIL.   However I still do not see my DLL in  c:\windows\assembly.

Can anyone explain this?
ASP.NETVisual Basic.NET

Avatar of undefined
Last Comment
Jacques Bourgeois (James Burger)
SOLUTION
Avatar of Grant Spiteri
Grant Spiteri
Flag of Australia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of HLRosenberger
HLRosenberger
Flag of United States of America image

ASKER

Ah, thanks!   that explains my DLL.  now I see it!   Why do I not see the third party DLL in the %windir%\Microsoft.NET\assembly\ path?  Instead I see it in c:\windows\assembly.  

However, GACUTIL lisst both DLL.   Why?          
SOLUTION
Avatar of Grant Spiteri
Grant Spiteri
Flag of Australia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of HLRosenberger
HLRosenberger
Flag of United States of America image

ASKER

that was my guess.   So, this third party provides DLL's for .NET 1.1, 2.0, 3.5 and 4.0.   If I'm running 4.0, and my DLL uses the 4.0 version of the third party DLL, why would it end up in the older GAC location?  is there a way to force it into one location or the other?

And this means GACUTIL pull from both locations, since I can list my DLL and the third party DLL.  
is there a way to force it into one location or the other?

When anybody could "force" things like that, such as in the older System folder, it became a mess.

They solved that problem in .NET with the GAC and Gacutil. Let the GAC manage itself. The framework will find your dll that way. If everybody could start fooling around by "forcing" things, we would end up with the same old mess.

If you want to have control over the location of a dll, put it in the application folder or use a CodeBase in the assembly configuration file to specify where it is. If you want it in the GAC, let the GAC work for you.
Avatar of HLRosenberger
HLRosenberger
Flag of United States of America image

ASKER

Sorry. I do not want to force it.   I'm trying to understand why the third party DLL I am using is in one GAC and my DLL is in the other.   I'm using .NET 4.0.  If the third party DLL is meant to be used with 4.0, why is it in the 2.0 GAC?  That's what I'm trying to figure out.
ASKER CERTIFIED SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of HLRosenberger
HLRosenberger
Flag of United States of America image

ASKER

Thanks so much. I appreciate that you took the time to explain.  One last question:  My DLL is not part of the framewok, but it was installed in the %windir%\Microsoft.NET\assembly.   Thoughts?
You should ask the gods at Microsoft. They often have strange ways, but usually good answers to explain their ways :-)
ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo