BrianH
BrianH

Reputation: 1080

.Net Deployment Project's Detected Dependencies magically un-excluded

I have a Visual Studio 2005 .NET solution that has 20+ sub projects including a deployment project. The VS2005 .NET deployment project has a number of detected dependences, that have been manually excluded and corrected values manually added in.

Sometimes however, these detected dependencies get magically un-excluded, which triggers a warning on the build: WARNING: Two or more objects have the same target location ('[targetdir]\')

What is the trigger that causes a detected dependency to be un-excluded? Can deployment solutions have their warnings treated as errors so the nightly build won't proceed?

Upvotes: 5

Views: 6879

Answers (4)

awestley
awestley

Reputation: 41

It happens when the dependent project has "Copy Local" set on a dependent DLL. The deployment/setup project has both the source and the copy of the DLL listed as a dependency.

Upvotes: 1

JasonRShaver
JasonRShaver

Reputation: 4394

I have had that same issue and dealt with it for about a year before giving up and moving over to WiX. It also did not help that I had to 'double-build' my builds because MSBuild for VS2005 will not work with deployment projects.

Anyway, you may want to consider something like WiX for your installs.

Upvotes: 1

Binary Phile
Binary Phile

Reputation: 2668

The discussion of detected dependency refreshes here may explain the behavior if you're using multiple development environments with the same project:

http://www.xmission.com/~legalize/msi/known-bugs-2003.html

Upvotes: 0

Kostas Konstantinidis
Kostas Konstantinidis

Reputation: 13727

Ok this is more of a hack than anything else :)

You normally under visual studio have 2 options:

a) Exclude the duplicated DLLs
or
b) Set the Condition property of your duplicated DLLs to something different.

Problem is that with both of these approaches, you are still gonna have them magically reset and get the warning like before..

What worked for us is the following solution:

a) Go to your setup project and create a Custom Folder

b) Set the DefaultLocation property of your custom folder to be the same as the one you need those DLLs to be placed. ie for ASP.NET applications the value is [TARGETDIR]\bin

c) Then drag and drop ALL the duplicated dlls into this folder and you should get no warnings now.

That's it. You should get no warnings for those dlls, if you have any extra just drag them into this folder.

Hope this helps.

-Konstantinos

Upvotes: 0

Related Questions