Home All Groups Group Topic Archive Search About
Author
9 Nov 2005 7:40 PM
moWhite
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?

Author
9 Nov 2005 7:49 PM
David Browne
Show quote
"moWhite" <moWh***@discussions.microsoft.com> wrote in message
news:6D8D7189-9256-4A64-893A-27FF1F45B6E5@microsoft.com...
>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
Author
10 Nov 2005 12:32 AM
moWhite
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


Show quote
"David Browne" wrote:

>
> "moWhite" <moWh***@discussions.microsoft.com> wrote in message
> news:6D8D7189-9256-4A64-893A-27FF1F45B6E5@microsoft.com...
> >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
>
>
>

AddThis Social Bookmark Button