Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Global assembly Cache

Status
Not open for further replies.

dpanattoni

IS-IT--Management
Jan 29, 2002
76
US
I might have misunderstood the purpose of the GAC. Please correct me.

My thoughts of it were that I could create a library (dll) file and put it into the GAC. Then I could write other applications that used that library. If I made changes to the library, I could make those changes, update the GAC and all of the existing programs that needed that library would then be able to use the updated library without the need for rebuilding.

I have been able to create libraries and update the GAC, but I still have to rebuild any application that uses that library if the library is changed. Am I missing something or is this the way it needs to be done? If this is the way it is supposed to be done, where is the advantage to using the GAC, I might just as well have skipped the GAC part since I can already share libraries by referencing them from within the application.


By the way, I'm using VS.net and C#.

Thanks in advance.
DP
 
Check your AssemblyInfo.cs file. By default, VS leaves your version at 1.0.*, which means every time you build the version number changes. When this happens, the GAC thinks you're doing side-by-side versioning and puts the new copy of your DLL in there with all the previous versions. By fully specifying the version: "1.0.0.0" you avoid this problem.

Of course, you must also be much more disciplined about how you change the call interface into your DLL. Make the wrong change and now your calling code can't call it!

Chip H.
 
Help ... how do you update the GAC?. I'm running into problems where I ran a hotfix for a vendors dll.... It runs fine on my development machine ... but when I uploaded to the server I get a Access denied Parser Error error
'Infragistics.Shared.V3'

To confess I've played around with c:\winnt\assembly where I saw this file previously and deleted it ... because I already have it in my applications 'bin' folder ....

How do I update the GAC with the same dll if I need to..?
 
There is a command line tool called gacutil which comes with the framework SDK that can register and unregister assemblies to the GAC. Alternatively you can use Windows Explorer. Although the GAC doesn't exists as a directory in the strict sense you can see all assemblies within it by browsing to

C:\WINDOWS\assembly (XP) or C:\WINNT\assembly (2000)

You can drag and drop dlls into the GAC the same as any other file to a folder in windows explorer.

Rob

Go placidly amidst the noise and haste, and remember what peace there may be in silence - Erhmann 1927
 
I have experienced, when simply going into c:\windows\assembly and deleting the GAC object, it does not completely remove the item...we had to restart the IIS services I believe...for best results use the Visual Studio.Net Command Prompt and run

gacutil \u GACOBJECTNAME

to delete the dll reference...

also, you may check if you're doing a copy local with the reference in your project, that can also affect which version you're using...
 
I set Copy local =True so i expect it to use the dll in my apps bin folder. I keep getting "Access is denied" error. It looks like a framework bug ... thisis a link i found that appears to be just my my problem ...


i'm going to try this solution.. but has anyone come acroos this ... after updating the bin folder or the web.config ... please check the link!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top