PDA

Click to See Complete Forum and Search --> : Deploying a Class Library (.dll) to the GAC *RESOLVED*


foot
Aug 14th, 2002, 08:33 AM
I created a .dll called DataAccess.dll with a strong name and have successfully added it to the GAC using the gacutil (gacutil /i d:\DataAccess\DataAccess.dll)

I have also added an entry for this program under the assemblies section of the machine.config file like so:
…<assemblies>

<add assembly="DataAccess, Version=1.0.954.23066, Culture=neutral, PublicKeyToken=541ca2b7bdb7a906" />

</assemblies>


When I attempt to run my .exe with the DataAccess.dll deployed in the same directory as the .exe it works fine. When I attempt to run the .exe without DataAccess.dll in the directory, it is in d:\DataAccess and registered in the GAC, I get this error: “File or assembly name DataAccess, or one of its dependencies, was not found”

The other program that will use DataAccess.dll is an ASP.NET page. Compiled debug it shows the paths it is searching for this file, they are all project related directories (ex. d:/inetpub/wwwroot/SPGen/bin/DataAccess.dll).

Any ideas what I’ve done incorrectly?

Thanks
Brad

Cander
Aug 14th, 2002, 08:49 AM
hmm only thing I cna think of it to check c:\winnt\assembly in Windows Explorer and make sure your dll is listedd

:confused:

foot
Aug 14th, 2002, 09:24 AM
I double checked winnt\assembly and my dll is listed there and the codebase property shows the correct path to my dll.

DevGrp
Aug 14th, 2002, 08:01 PM
Hey foot, make sure you add a reference to the dll.

foot
Aug 15th, 2002, 08:51 AM
I do have a reference to the dll. Do I need to add the reference differently for a GAC dll?

Cander
Aug 15th, 2002, 09:04 AM
no..it should be the same. Perhaps when you tested it with the dll that was local, you referenced that one so now when you are tyrying to use the one in the gac, it is still trying to read the original. Try removing the reference and add it again making sure you are refering to the one in the GAC.

:confused:

foot
Aug 15th, 2002, 09:34 AM
Figured it out. In Reference Path, under project properties, I needed to add c:\winnt\assembly.

Thanks, I appreciate your help.
Brad

Cander
Aug 15th, 2002, 09:36 AM
cool. so it was trying to use the wrong reference.

Good luck.