Global Assembly Cache problem

k4zz

New Member
Forgive me if I ask a question that's already been answered. I did try searching but didn't find much.<BR><BR>I created a simple business test object and put it in the GAC, but I can't seem to reference it from an ASP.NET Application. I was wondering if anyone has any idea what I am missing.<BR><BR>I followed the below procedure:<BR>1) Wrote the business class, gave it the namespace BusinessObjects, class name BusinessObject.<BR>2) Used the sn.exe tool to create a Key Pair File (Test.snk)<BR>3) Used the vb compiler command tool (vbc.exe) to generate a dll (BusObjects.dll), specifying the Test.snk file.<BR>4) Used gacutil.exe -i BusObjects.dll to add it to the GAC.<BR>5) Did a gacutil.exe -l, which showed BusObjects.dll in the cache.<BR>6) Tried instantiating it as an object, but get an error that the Namespace cannot be found.<BR><BR>Note: When I look at it in the GAC, BusObjects.dll has version of 0.0.0.0. Would this matter at all?<BR><BR>Any help would be much appreciated.Hi Paul. To fix this you have to specify in your Web.config file to use the assembly. Simply specify this in your Web.config file like so:<BR><BR><compilation debug="false" explicit="true"><BR> <assemblies><BR> <add assembly="AssemblyName, Version=VersionNumber, Culture=neutral, PublicKeyToken=PublicKeyTokenValue"/><BR> </assemblies><BR></compilation><BR><BR>Alternatively, you can add this in the machine.config file, and ALL of your ASP.NET Web pages in all of the Web applications will be able to use the GACed component.<BR><BR>hthThanks for the response Scott.<BR>I added that to web.config (cut and paste the actual info from the gac listing, so I wouldn't get the key wrong), but still I can't access the assembly in my code.<BR><BR>It's probably something really simple that I am missing, but I'm stumped as to what it is. I'll keep playing with it.<BR><BR>Thanks again for the help.
 
Back
Top