Global Assembly Cache

IfYouSaySo

Well-known member
Joined
Jan 4, 2006
Messages
102
Location
Hermosa Beach, CA
Programming Experience
3-5
Ok, so I've written a library in VB.NET (.NET data provider), I have the .dll. I gave it a strong name via sn.exe -k key.snk and then referenced the key file in the assemblyinfo.vb file. I ran gacutil i/ MyCompany.CsvProvider.dll and it says it installed properly in the gac, I verified that there is an entry for my dll in C:\Windows\assembly\ which is I assume the location of the GAC. At this point I thought I should be able to reference the .dll from another project(?), so I start another project and do:

VB.NET:
Imports MyCompany.CsvProvider
 
Module Module1
    Public Sub Main
        Dim x As New CsvConnection
        ' etc.
    End Sub
End Module

and Visual studio complains: Module1.vb(1): Namespace or type 'CsvProvider' for the Imports 'MyCompany.CsvProvider' cannot be found.

Any ideas on what I'm missing?

Thanks...
 
You cannot simply import a namespace without adding a reference to the assembly that contains it. You still have to add a reference to your assembly whether it's in the GAC or not. If the assembly has been loaded in the GAC then it will appear on the .NET tab of the Add Reference dialogue instead of you having to browse to locate the actual DLL file.
 
Back
Top