Excluding Files from a Visual Studio Web Setup Project

I have a web setup project in VS. I will switch to WiX, but in the future and now I need to solve the following problem.

I need to exclude some common DLLs from the project. Therefore, I am building a project, VS updates the list of detected dependencies. I exclude them and the assemblies are installed. I check the file list with Orca and the files are not included in the installer.

But when I clean my output directory, reload the solution and build, some of the dependencies do not appear as excluded! And so they end up in MSI. (This is what happens on the build machine).

I think the problem may be that these are second-level dependencies: my app -> NHibernate.dll -> Antlr3.Runtime.dll (Antlr dll gets into MSI).

Is this a mistake or am I missing something?

+3
source share
1 answer

I found this page in msdn, which has a workaround for the Exclude flag, which is reset, for False:

Previously excluded files are included again when the solution is reopened

When you exclude a file from the installation project, you can see that the file is included again after closing and reopening the solution. This can happen if two copies of the same dll file come from two different sources.

To work around this error, change the Copy Local property to one of the files:

In Solution Explorer, click the link for the DLL that you want to remove.

From the View menu, select Properties.

Change the Copy Local property to False.

+2
source

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


All Articles