Search code examples
visual-studio-2012mefprojects-and-solutions

Shared assembly is duplicated on build


Probably a stupidly simple question but I can't seem to find an answer online.

I have a solution with projects A, B and C.

Projects B and C have a reference set to Project A.

Projects B and C have their output path set to a subdirectory of Project A's output directory.

Project B and C have a reference path set up to look in Project A's output directory.

The problem is, Project A is getting placed in Project B and C's output directory as well as in it's own directory. This is causing problems with using MEF unless I manually delete the duplicated assembly.

I'm getting this structure:

[OutputPath]
    ProjectA.exe
    [Subdirectory]
        ProjectB.dll
        ProjectC.dll
        ProjectA.exe

How can I prevent Project B and C from rebuilding Project A in their own output directory so I end up with this directory structure after each build?

[OutputPath]
    ProjectA.exe
    [Subdirectory]
        ProjectB.dll
        ProjectC.dll

Solution

  • The solution was to look at the properties for the references themselves and set "Copy Local" to false.