locked
How to refer assembly installed in GAC RRS feed

  • Question

  • Hi,

    I have an assembly installed in GAC.

    It is also registered.

    i am trying to add a reference in one of my project.

     i am doing a add reference and using the browse tab to go to the path

    "C:\Windows\Assembly" and able to see the dll there.

    But i am not able to add it.

    Can any one please let me know the process to refer it.

    Wednesday, March 14, 2012 7:22 AM

Answers

  • I did the following process to get it done

    1-> goto start -> run -> type "C:\Windows\assembly\gac_msil" -> press enter

    2-> search your .dll that you want.

    3-> copy the complete path of the dll that you want to add.

    4-> go to project -> add reference -> in the file combox past the copied dll path -> Ok

    you will be able to add the dll to your references.

    Note: you cannot traverse to path "C:\Windows\assembly\gac_msil" in the add reference dialog box so copy the full dll path.

    • Marked as answer by Gyana Thursday, March 15, 2012 11:33 AM
    Thursday, March 15, 2012 11:32 AM

All replies

  • Hi,

    as i understand it, you need to reference a normal assembly, in a normal folder.

    The loading mechanism will load it from the GAC if the exact same file is also installed in the GAC.

    here' s some explanation on loading precedence:

    http://stackoverflow.com/questions/1606273/net-assembly-loading-priorities



    Regards, Nico

    Wednesday, March 14, 2012 7:52 AM
  • Check the below link which answers your question.

    http://stackoverflow.com/questions/5113186/why-is-my-assembly-not-visible-in-add-reference-net-when-installed-to-the-g

    I hope this helps.


    Please mark this post as answer if it solved your problem. Happy Programming!

    • Proposed as answer by Lie You Thursday, March 15, 2012 7:57 AM
    Wednesday, March 14, 2012 8:33 AM
  • Hello Gyana,

    in addition to the answers.

    First of all forget the GAC. There two ways to add a reference to Your project.

    press project > properties > references > add

    1. choose .NET (or.COM) Now You get a list of all NET components on Your System. Choose one item and press OK. The problem is You have to know the name of this object library You whants to add.

    2. choose search. Here You can choose the DLL direct. The problem is, You must know the DLL name and the folder where it is stored. Find DLL and press OK.

    The GAC is only necessary for the app to find the assembly.

    regards Ellen


    Ich benutze/ I'm using VB2008 & VB2010

    Wednesday, March 14, 2012 10:59 AM
  • I did the following process to get it done

    1-> goto start -> run -> type "C:\Windows\assembly\gac_msil" -> press enter

    2-> search your .dll that you want.

    3-> copy the complete path of the dll that you want to add.

    4-> go to project -> add reference -> in the file combox past the copied dll path -> Ok

    you will be able to add the dll to your references.

    Note: you cannot traverse to path "C:\Windows\assembly\gac_msil" in the add reference dialog box so copy the full dll path.

    • Marked as answer by Gyana Thursday, March 15, 2012 11:33 AM
    Thursday, March 15, 2012 11:32 AM