CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2

Thread: C# GAC assembly problem

  1. #1
    Join Date
    Feb 2009

    C# GAC assembly problem

    Hi All,

    I am having a rather peculiar issue.
    I have a library let's call it A which depends on two other libraries
    B and C.

    Both B and C are installed in the GAC. I am trying to compile the
    sourcecode for A but i'd like to reference the GAC for the library
    dependencies. Do you know how I can do that from the command line?

    This is what I was trying:

    > csc.exe /t:library /out:A.dll /r:B.dll,C.dll A.cs

    this method only works if i specify an aboslute path for B and C. What
    i want is to have those assemblies not be references but like a linked
    resource.. Any ideas...?


  2. #2
    Join Date
    Mar 2004
    Prague, Czech Republic, EU

    Re: C# GAC assembly problem

    GAC is for run-time. Compiler doesn't look for assemblies in it. For compile-time, you have to have local copy of the assembly, althought for run-tim, you can distribute the application without it if you can be sure, that it is present in GAC on the machine where the application will run.

    If you want to avoid specifying the path on command line (but if you look at temporary files produces by VS, you could see that there are full paths), you can edit the file csc.rsp in framework's home dir and append a /r: switch here, or you create your own .rsp file and pass it to csc.exe with @filename as command line parameter.
    • Make it run.
    • Make it right.
    • Make it fast.

    Don't hesitate to rate my post.

Tags for this Thread

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)