Copy Local and GAC

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an assembly that uses a third-party object that is installed in the
GAC. I set the references "Copy Local" property to true and compile my
assembly. The third-party object is in fact copied to my output directory.

I have another assembly that uses my first assembly. I set the references
"Copy Local" property to true and compile my assembly. I would expect that I
would see both my first assembly and the third-party assembly in my second
output directory, but I don't.

Why?
 
moWhite said:
I have an assembly that uses a third-party object that is installed in the
GAC. I set the references "Copy Local" property to true and compile my
assembly. The third-party object is in fact copied to my output
directory.

I have another assembly that uses my first assembly. I set the references
"Copy Local" property to true and compile my assembly. I would expect
that I
would see both my first assembly and the third-party assembly in my second
output directory, but I don't.

Why?

Because "Copy Local" is not recursive. Just set a direct reference from the
other project to the Third-Party project, and it will be copied too.

With Assemblies A,B and C
A --references--> B --references--> C

When you build A, B will be copied but C will not. But you can always add a
direct reference from A to C just so the Visual Studio can keep track of the
dependency and copy C into A's bin directory on build.

David
 
Wow, I've been doing this .NET stuff since the beginning and I did not know
that.

I'm trying to confirm what you are saying right now, but can you point me to
an MSDN Library explaination of this?

Thanks, Richard
 
Back
Top