Why is the exclude property of assemblies under "discovered dependencies" in vdproj not saved?

I have a simple problem. I want to exclude some of the dll dependencies (in the discovered dependencies folder) in my installation project so that they are not copied to the users installation folder. I solved this by setting the exclude property to true on assemblies that I don't want, and then create the msi file. It works great, builds are excluded.

However, if I close the visual studio and reload it, only one of the “exclude” properties (from 4 in my case, which I set) remains true. I checked the vdproj file and there are 4 lines there, for example:

"Exclude" = "11:TRUE" 

... one for each of the collections that I wanted to exclude.

So it looks like VS2010 is loading the settings from the vdproj file incorrectly. I am puzzled. Does anyone have a workaround?

+4
source share
2 answers

This is because the dependency analyzer always adds DLLs to the deployment project if their Copy Local properties are set to true. See the section “Previously excluded files are included again when you reopen the solution” in the MSDN article, “Troubleshooting,” and deployment projects . You will have to choose between using Visual Studio Copy Local and use the deployment project to install the files in the right place, especially in a complex solution.

+4
source

This is for all the people who come here to look for a solution!

Well, I had the same problem as mentioned above, but the DLL I wanted to avoid was the detected deprivation (my project A depends on B.dll, which has a dependency on C.Dll (2.0.0.0)), but I dont want C.dll (2.0.0.0) in my MSI (since I have a direct dependency on another version of C.dll (1.0.0.0)). I tried to exclude the DLL, but this will not work, since VDProj updates the dependency every time I reload the project and add the detected dependency back.

Microsoft's solution was to make the CopyLocal property false for the linked DLL, I had so many of these DLLs, and I didn’t want to go into every project and update it (since this could trigger testing efforts for heaven, because which, according to testers, the code for a large number of projects is practically changing). Therefore, I worked on this by adding a specific DLL (C.Dll (1.0.0.0)) to the installation project manually. Just right-click the installation project and select the file.

enter image description here

also do not forget to specify the location where you want the file to be deployed, in my case it ended up in the BIn folder.

enter image description here

This file will override all other detected dependencies (with a similar name) and will be deployed to the location we specified.

+1
source

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


All Articles