Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make a Visual Studio project file to copy indirect references?

enter image description here

As the screenshot shows, ClassLibrary1 relies on ClassLibrary2 and ClassLibrary2 relies on ClassLibrary3. And "Copy Local" is set to be "True". But when I compile ClassLibrary1, ClassLibrary3 won't be copied to the bin folder.

So how can I config the Visual Studio project file to make it copy indirect references?

like image 387
Cui Pengfei 崔鹏飞 Avatar asked Nov 28 '11 03:11

Cui Pengfei 崔鹏飞


People also ask

How to Add references from one project to another in Visual Studio?

You can also right-click the project node and select Add > Project Reference. If you see a References node in Solution Explorer, you can use the right-click context menu to choose Add Reference. Or, right-click the project node and select Add > Reference.

How to Add references to project?

Add a reference In Solution Explorer, right-click on the References or Dependencies node and choose either Add Project Reference, Add Shared Project Reference, or Add COM Reference. (You can right-click the project node and select Add from the fly-out menu to choose from these options, too.)

How to Add reference in csproj file?

To add a reference in Visual Studio, right click the "references" folder > choose "add reference" and then "Browse" to you DLL.


1 Answers

I don't think that this is possible.

If you want the indirect references to be copied locally, you will have to add a direct reference to them to each project that you want them to be in.

If you try to build the project using MSBuild you will probably be informed that the indirect dependency is missing; Visual Studio usually ignores the missing indirect dependencies if you aren't directly using anything from them.

like image 130
competent_tech Avatar answered Oct 23 '22 12:10

competent_tech