Results 1 to 8 of 8

Thread: Deploying a Class Library (.dll) to the GAC *RESOLVED*

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    10

    Deploying a Class Library (.dll) to the GAC *RESOLVED*

    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
    Last edited by foot; Aug 15th, 2002 at 09:34 AM.

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    hmm only thing I cna think of it to check c:\winnt\assembly in Windows Explorer and make sure your dll is listedd

    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    10
    I double checked winnt\assembly and my dll is listed there and the codebase property shows the correct path to my dll.

  4. #4
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Hey foot, make sure you add a reference to the dll.
    Dont gain the world and lose your soul

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    10
    I do have a reference to the dll. Do I need to add the reference differently for a GAC dll?

  6. #6
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    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.

    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  7. #7

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    10
    Figured it out. In Reference Path, under project properties, I needed to add c:\winnt\assembly.

    Thanks, I appreciate your help.
    Brad

  8. #8
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    cool. so it was trying to use the wrong reference.

    Good luck.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width