Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 Setup Project - Two or more objects have the same target location

I am trying to deploy some 3rd party DLLS to the GAC folder of client machines to reduce the install size of my apps...the problem I have is, when I run the installer on client machines I get the error...'Error writing to the file:xxxx.dll. Verify that you have access to that directory"...I happen to trace this error back to mean...duplicate files in deployment package.

In my VS2010 Setup project, when looking at the details of the special folder "Global Assembly Cache Folder" I do see some items underlines in red which are duplicate names, however, in the project files there is only one of each dlls...no duplicated.

I believe some of the dlls are dependent on each othere...how do I remove the duplicates without removing the dlls from the project?

I tried "right-mouse-click" on one of the items underlines and click delete, but that removes the dll from my project entirely.

I found a similar question here but this doesn't help.

Here is how I am creating my setup project

  1. Create a new VS2010 Setup project
  2. Add a Special Folder (Global Assembly Cache Folder) to "File System on Target Machine"
  3. Right-mouse-click on Global Assembly Cache Folder and choose "Add File"
  4. Select my multiple DLLS
  5. Build project
like image 989
Saif Khan Avatar asked Feb 01 '26 02:02

Saif Khan


2 Answers

Found the solution...just exclude the items in the dependency folder.

like image 156
Saif Khan Avatar answered Feb 03 '26 10:02

Saif Khan


I ran into the same problem while creating multiple merge modules and then attaching them to the other deployment projects: the same files of detected dependencies for the assembliues in merge modules ended up clashing with "two or more objects have the same location" message.

To solve this I opended *.vdproj files in the text editor and made sure each merge module uses different property name for the [TARGETDIR] (module retargetable folder). Normally, it was previously [NEWRETARGETABLEPROPERTY1] - the warningn message will show you.

like image 30
NSH Avatar answered Feb 03 '26 10:02

NSH