How to use a shared assembly stored in GAC?

G

Guest

I'm having a problem in using the assembly (class lib application) stored in GAC. I can see the assembly added in GAC from winnt\assembly folder but I cannot able to use it. If I type imports in VS.NET, I cannot see my namespace in PopUp. Everytime I have to use that assembly as a private assembly by setting reference for every project I want to use that assembly

Can anyone explain me what's going wrong? I want to use my assembly just as like system.data (for eg. Just say Imports MyApplication.Utilities.LogManagement and use in my application). Can anyone explain me the difference of doing Imports and Add reference in VS.NET

TIA
Hol
(A newbie.NET)
 
B

Brian Newtz

Holy,

Even though your assembly is in the GAC, you still have to add a reference
to it in your application in VS.NET. When you reference your assembly, it's
not being used as a private assembly, even though you might think it is.

To make things easier on the developer, you usually store a copy of your
strongly-named dll in a folder like c:\program files\common files\[component
name]\

Then, in VS.NET, you reference this assembly. However, at run-time, .NET
checks the global assembly cache when it needs to resolve the assembly
location first. It finds it there, and uses it.

To prove this, you can look at the properties window of the referenced dll
in VS.NET, and you will see that the "Copy Local" property is "false",
meaning that it knows your assembly is strongly-named and installed in the
GAC, causing it to not be copied to your application's private path when
compiled.

Hope this helps.

-Brian


Holysmoke said:
I'm having a problem in using the assembly (class lib application) stored
in GAC. I can see the assembly added in GAC from winnt\assembly folder but I
cannot able to use it. If I type imports in VS.NET, I cannot see my
namespace in PopUp. Everytime I have to use that assembly as a private
assembly by setting reference for every project I want to use that assembly.
Can anyone explain me what's going wrong? I want to use my assembly just
as like system.data (for eg. Just say Imports
MyApplication.Utilities.LogManagement and use in my application). Can anyone
explain me the difference of doing Imports and Add reference in VS.NET?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top