February 24th, 2009, 04:06 PM
C# GAC assembly problem
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...?
February 25th, 2009, 03:31 AM
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.
Don't hesitate to rate my post.
- Make it run.
- Make it right.
- Make it fast.
Tags for this Thread
Click Here to Expand Forum to Full Width