"Unable to update dependencies of the project" after committing to Subversion

Closing VS2010 and then re-opening it has always worked for me :)


There is a long discussion thread about this on MSDN. It seems like there are many possible causes. The discussion includes a few links for this problem from Microsoft. Here is a hotfix for VS2005 and here is a workaround for VS2010.


I've had the same issue, but none of the mentioned resolutions seemed to work for me. Rebuilding the setup project would work, but it is a pain, since we include the project outputs of 30+ projects.

The thing I found to work is a very similar approach to what @Marc did.

  1. I noted which dependencies were reported by Visual Studio as errors
  2. Edit the .vdproj file in Notepad++
  3. Search for the .dll that is giving issues. You will see a "ScatterAssemblies" section. If it is empty, delete the whole dll reference
  4. Save file

In all cases I had multiple references to the same dll (not sure how this happened)

Example of correct reference:

"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_11EC89A306FFB83A269ACC2BF8D8462B"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:Some.OrOther.Lib, Version=1.601.4042.16978, Culture=neutral, processorArchitecture=MSIL"
                "ScatterAssemblies"
                {
                                "_11EC89A306FFB83A269ACC2BF8D8462B"
                                {
                                "Name" = "8:Some.OrOther.Lib.dll"
                                "Attributes" = "3:512"
                                }
                }
"SourcePath" = "8:Some.OrOther.Lib.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_79891234C744498C83755DDEA682F0BF"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}

Example of incorrect reference:

"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_11EC89A306FFB83A269ACC2BF8D8462B"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:Some.OrOther.Lib, Version=1.601.4042.16978, Culture=neutral, processorArchitecture=MSIL"
                "ScatterAssemblies"
                {
                }
"SourcePath" = "8:Some.OrOther.Lib.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_79891234C744498C83755DDEA682F0BF"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}

I also got the same "Two or more objects have the same target location ('[targetdir]\MyAssembly.dll')" warning that @Marc got ... but the setup project compiles and runs fine.


Correct link for hot-fix for VS2010 is:

http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=30681

Works fine after installation


I had the similar problem and found a fix in this very long and old discussion on MSDN.
As the user 'Jeff Hunsaker' on Thursday, August 26, 2010 5:51 PM answered (direct link not possible):

I just encountered this when upgrading Visual Studio 2008 Deployment Projects to VS 2010. Hans' (above) solution worked for me.

  1. Edit the .vdproj file in Notepad.
  2. Search for "SourcePath" = "8:
  3. For each assembly/dll, provide the full path
  4. Save file

Within my .vdproj file, I had several entries simply referencing the assembly:
"SourcePath" = "8:MyAssembly.DLL"

Even though Visual Studio [somehow] knew the file location, I received the "Unable to update the dependencies of the project" error until I provided the full path:

"SourcePath" = "8:..\..\..\build\bin\MyCompany.MyAssembly.DLL"

Regards,

Jeff...

I noted which dependencies were reported by Visual Studio and wrote a script to fix them in case this is required.

Note that this now gives me a warning "Two or more objects have the same target location ('[targetdir]\MyAssembly.dll'). But I can live with that.