locked
Unable to reference assembly in GAC using csc RRS feed

  • Question

  • Hello,

    I have compiled an assembly and placed it in the GAC.

    But, if i reference it in csc, i am getting a message saying that it cannot find the specified file.

    The command i am entering is: csc /r:c:\windows\assembly\<assemblyname.dll> <source.cs>

    And, do i have to enter the full path(c:\windows\assembly\<assemblyname.dll>) or is there another way as the assembly is in the GAC?

    Vijay Vishwanath


    Thursday, December 8, 2011 4:52 PM

Answers

  • You can't reference assemblies in the GAC this way.  You'd need to put the full path (including the weird portions) to the actual assembly.  That being said, it's typically much simpler to just copy the assembly out of the GAC - for details, see: http://stackoverflow.com/a/885110/65358
    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    • Marked as answer by Vijay Vishwanath Thursday, December 8, 2011 5:18 PM
    • Unmarked as answer by Vijay Vishwanath Thursday, December 8, 2011 5:18 PM
    • Proposed as answer by servy42 Friday, December 9, 2011 6:59 PM
    • Marked as answer by Reed Copsey, JrMVP Thursday, December 15, 2011 5:51 PM
    Thursday, December 8, 2011 5:07 PM

All replies

  • You can't reference assemblies in the GAC this way.  You'd need to put the full path (including the weird portions) to the actual assembly.  That being said, it's typically much simpler to just copy the assembly out of the GAC - for details, see: http://stackoverflow.com/a/885110/65358
    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    • Marked as answer by Vijay Vishwanath Thursday, December 8, 2011 5:18 PM
    • Unmarked as answer by Vijay Vishwanath Thursday, December 8, 2011 5:18 PM
    • Proposed as answer by servy42 Friday, December 9, 2011 6:59 PM
    • Marked as answer by Reed Copsey, JrMVP Thursday, December 15, 2011 5:51 PM
    Thursday, December 8, 2011 5:07 PM
  • Hello,

    Okay, thanks for the reply.

    Vijay Vishwanath

    Thursday, December 8, 2011 5:19 PM