4 Copies of my dlls instead of 1?

I have a solution with two projects.

Both projects need the same 4 DLLs.

I have a lib folder with 4 DLLs in each project.

When the solution compiles, 4 DLLs in each lib folder are copied to the bin folder.

Now there are 4 sets of 4 DLLs.

I tried to put the DLLs in the bin directory, but Visual Studio threw a lot of errors on this.

How it works? Ideally, I would like only one set, two max. Not sure where I should put my dlls to fix this.

+4
source share
2 answers

Yes, that’s how it should work.

You can customize this process by changing the CopyLocal property of your links to false.

Set true in your startup project and false in another.

+4
source

In each project you refer to them (right-click on the project and "Add Link"). After creating your solution or project, Visual Studio should automatically copy the required reference dlls to the /bin for you.

As for multiple copies, since each project is usually autonomous, each of them will have a set of reference DLLs, however, if Project A refers to Project B and you use Project A (for example, Project B is a class library), then for project A there should be only 6 dlls.

 - ProjectA/bin/Debug/projectA.dll - ProjectA/bin/Debug/projectB.dll - ProjectA/bin/Debug/shared1.dll - ProjectA/bin/Debug/shared2.dll - ProjectA/bin/Debug/shared3.dll - ProjectA/bin/Debug/shared4.dll 
+3
source

Source: https://habr.com/ru/post/1447065/


All Articles