Gac

softwarevj

Member
Joined
Feb 14, 2006
Messages
15
Location
India
Programming Experience
1-3
Hi frnds,

I have a problem working with GAC.
I have developed a DLL file. Have put it in the GAC. Now I want to use it within all the new projects i am doing. I can use this file if I add the reference in my project using Add Reference. That way I am including the reference of file into my project.I have to use imports statement also.
I want to use the file within GAC just using the imports statement and do not want to add any reference of the dll file using ADD reference. Is that possible. If not what is the fun of putting it in GAC. We can still use it without putting it in GAC. Please help.

Thanking you in advance.

Software VJ
 
Not to hot on this but as i understand it the whole of the .net framework is in the global assembly cache, but you still need to add a reference to it to use the DLL in your project. You only have to look at the references section of a project in the solution explorer to see that. If you strongly name your DLL it wil be deployed in the GAC on the host computer, so why use it? Well i've heard somw developers say that they use it to keep prying eyes of their DLL because of the way that the fusion DLL renders the Assembly folder, however thats not too effective if you know how to disable the fusion DLL. Maybe performance? Well, i dunno.. the first place the CLR will look for an assembly is in the native image cache, then the GAC then elsewhere. So possibly you may get a very tiny performance increase when you first start up your app. I suppose, and this is just my opinion, the main reason would be for a slightly lesser security issue. When strongly naming your DLL checking for assembly and build numbers is automatic if they don't match you can display an error. I guess this is to stop your code being altered and to prevent the DLL from being moved to another machine. As i say just my opinion, and if i got it all wrong i'm sure someone will correct me shortly....
 
"It is highly recommended that you not install your assemblies to the GAC, unless you want to share your assemblies with other applications running on that system. Also, note that it is not possible to directly reference an assembly from the GAC in your project. If you want to use an assembly from the GAC, you should drop your assemblies to a local folder, and then add a reference to the assembly from this folder. You may want to set the Copy Local property to False for that assembly if you do not want the assembly to be copied locally to your project folders. At runtime, the application will use the assemblies from the GAC."
http://support.microsoft.com/default.aspx?scid=kb;en-us;306149
 
Back
Top