using the GAC

Discussion in 'MCSD' started by Session, May 3, 2004.

  1. Session

    Session Guest

    can someone tell me how to reference a dll that is
    installed on the GAC? I keep trying to do so, but I end
    up just getting a local copy of the dll in my bin file,
    not the version that is on the GAC. How should I
    reference it from a project? the add reference procedure
    doesn't include items in the GAC. Thanks

    Session
     
    Session, May 3, 2004
    #1
    1. Advertising

  2. Session

    Eric Guest

    Session wrote:

    > can someone tell me how to reference a dll that is
    > installed on the GAC? I keep trying to do so, but I end
    > up just getting a local copy of the dll in my bin file,
    > not the version that is on the GAC. How should I
    > reference it from a project? the add reference procedure
    > doesn't include items in the GAC. Thanks


    You should keep a local copy of any .dll installed in the GAC. Just use
    the local copy for the purpose of making a reference.

    The pathname is not important in this. If you reference a local copy,
    it will still use the one in the GAC at runtime. The Framework process
    of locating a DLL is called "Fusion".

    This is an important area for most of the cert tests - you need to
    understand deployment pretty well. Kalani does a pretty good job of
    explaining it.

    Eric
     
    Eric, May 4, 2004
    #2
    1. Advertising

  3. >You should keep a local copy of any .dll installed in the GAC. Just use
    >the local copy for the purpose of making a reference.


    just to add to that. This is mandatory if you want your component to
    appear in the vs.net references.

    Kline Sphere (Chalk) MCNGP #3
     
    The Poster Formerly Known as Kline Sphere, May 4, 2004
    #3
  4. >How should I
    >reference it from a project? the add reference procedure
    >doesn't include items in the GAC.


    Yes it does, but only if vs.net knows where to look for your
    assembles!

    Assuming you have done the basic's correctly, i.e. created a keyfile
    with the strong name tool, added a entry in your assemble file to
    point to keyfile and added the assemble to the gac, then....

    In order to be able to view your assembly in the vs.net 'add
    references | .net' tab, you need to add an entry to the registry - See
    KB article 306149 in the MSDN which tells you how to do this.

    Kline Sphere (Chalk) MCNGP #3
     
    The Poster Formerly Known as Kline Sphere, May 4, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Silverstrand
    Replies:
    5
    Views:
    672
    unholy
    Sep 29, 2005
  2. Saga

    GAC: Global Assembly Cache

    Saga, Mar 1, 2005, in forum: MCSD
    Replies:
    2
    Views:
    499
  3. =?Utf-8?B?U2VudGhpbA==?=

    Load an dll from GAC in c#.net

    =?Utf-8?B?U2VudGhpbA==?=, Apr 15, 2005, in forum: MCSD
    Replies:
    5
    Views:
    20,292
    =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=
    Apr 20, 2005
  4. [BnH]
    Replies:
    3
    Views:
    537
    Walter Hofmann
    Sep 24, 2005
  5. Donald Burr
    Replies:
    3
    Views:
    1,033
    Whiskers
    Nov 14, 2006
Loading...

Share This Page