How does visual studio know my DLL needs to be copied

81 views Asked by At

Our solution has a "Lib" folder, which contains a DLL ("A.dll") stored in source control.

My Project looks like the following (simplified):

Website
- References
-  * Reference to A.dll from Lib folder below *
- Content
- Lib
-   A.dll (Build Action: Content, Copy to Output: Do not copy)
-   B.dll (Build Action: Content, Copy to Output: Do not copy)
- Migrations
- Views

A has a reference to/uses B, but B is not included as a reference within the Website.

When I hit compile Visual studio puts B in the bin folder, how did it know to do this? Even if I leave B where it is, but don't let the Website project see it (not include it in the project), it's still put in the bin folder.

However if I put B in the Migrations folder, it is not copied to the bin folder. The Lib and Migrations folder have no special properties against them (that I can see).

How does this work, is it documented?

1

There are 1 answers

0
Lee On

As per the comments, it was explained that the reason it is working in the instance is because it searched for B in the same location it found A.

As this helped my understanding, I've posted it as an answer in case it is of use to anyone else.

Thanks Hans for your help.