4

Something is causing my .vdproj to go haywire periodically and with no identifiable cause, resulting in the error message, "ERROR: Unable to update the dependencies of the project. The dependencies for the object 'Primary output from Cool Program (Active)' cannot be determined.". This pertains to Visual Studio 2017 Community Edition, 15.9.14, using the VisualSVN plugin and Tortoise SVN. I am also using Eziriz .NET Reactor for code protection. I used this configuration for a good 2 years with no issues. This has just started happening repeatedly so there must be something that has changed that is causing it - either some little attribute of my configuration that makes it go bonkers, or something in the environment it doesn't like. I just don't know how to figure out what it would be. The only change that stands out to me is that I had to change from .NET 4.6 to 4.6.1 because of an external dependency.

The setup & deployment project has suddenly started saying it can't find the dependencies for the active project. What's more perplexing is that yesterday, I did over 20 builds throughout the day and then it just mysteriously happened out of the blue. I had not opened or run any new programs that I recall, nor had I closed VS or changed anything in the environment. It was spontaneous and without any correlating system change that I know of. It seems as though Visual Studio simply lost its mind.

I have read other posts (Compile Setup project with devenv.com - "ERROR: Unable to update the dependencies of the project" and "Unable to update dependencies of the project" after committing to Subversion) on this error, examined my .vdproj, and previously tried different fixes the last time this happened:

What I Tried

  1. Checked .vdproj and confirmed that the path to the primary project was full and correct;
  2. Removing .vdproj from the solution and then re-adding it;
  3. Closing and re-opening VS;
  4. Emptying the Hierarchy and Files sections of .vdproj;
  5. Updated to the latest version of VS;
  6. Rebooting;
  7. Disabling performance monitoring & reporting;
  8. I thought that I fixed it by removing my primary project from the Setup project and then re-adding it, thus requiring multiple subsequent manual adjustments to the file layout, shortcuts etc., but this is a labor-intensive work-around, not a solution. And it turned out to work only temporarily - the problem came back.

UPDATE JAN 14 2020

While the work-around mentioned below helps temporarily, I was never able to fix this problem. It just kept coming back. My solution was to abandon the setup & deployment project completely and switch to Inno Setup. My advice to you, if you try all of these methods and can't fix it, is to do likewise.

technonaut
  • 484
  • 3
  • 12

3 Answers3

4

I've just noticed the same thing just started happening - also after many years without issue - and tried all those solutions you mentioned and none worked. Only difference is I'm on VS 2019, but same behavior.

On your setup Project, if you right click on "Detected Dependencies" folder and click Refresh Dependencies it probably says 'The operation could not be completed'

The problem seems to happen as dependencies cannot be automatically resolved without all files visible in the setup project's File System view.

The work around

  1. Right click on your setup Project name > View > File System
  2. Click on the "Application Folder" in the "File System on the Target Machine". Without this step the following step doesn't seem to work.
  3. Go back on your "Primary Output from Cool Project (Active)", right click and Refresh Dependencies
  4. Repeat step 3 multiple times until the "Application Folder" files finally updates without error (seems to do each one then shows an error)
  5. Now try to Rebuild your project
  6. If you're still getting issues, or now just getting issues via the command line builds, take a look at each of the DLLs in your Application Folder and double check their source location and version. You may find that the files point to an older version, so replace those files with the new version.
scottaj
  • 66
  • 4
  • Thank you, I will try this next time. To clarify, are you using VisualSVN or Eziriz .NET Reactor Automation plugin, and/or Tortoise SVN? – technonaut Aug 07 '19 at 19:03
  • Just .NET Reactor, which I assume would not impact any of the build dependencies as it's triggered in a post build event – scottaj Aug 07 '19 at 23:10
  • 1
    It just happened again. The good news is that **your method worked to resolve it**, and was far easier than manually re-adding the project output, so thanks again. For future reference, the error I got several times while attempting the refresh was, "The operation could not be completed. Exception occurred." – technonaut Aug 13 '19 at 09:51
  • 1
    @scottaj: I'm stuck at step 3. There is no **Refresh Dependencies** option in the context menu when I right-click **Primary Output from Project (Active)** or on **File System on Target Machine** or **Application Folder**. The only place where I see **Refresh Dependencies** option is when I right-click the **Detected Dependencies** node under the installer project in the **Solution Explorer**. I tried that option several times, but it keeps showing error message `This operation could not be completed`. – dotNET Mar 06 '20 at 07:29
1

I tried many of the solutions listed here to fix my Setup project. I also tried those listed at some other Stack Overflow questions. Fixes that ranged from editing the project file in text all the way down to restarting Visual Studio. None of them worked.

I've always added the Primary Output to the Application Folder in the File System view on a Setup Project. For the Setup project that wasn't behaving, I switched and added the .exe via Add -> File. The Setup project now compiles, and the resulting .msi file does a good install.

So while it isn't the 'right' way to configure a Setup project, it worked in this instance to solve my specific error. Maybe it'll solve your specific error too.

edhubbell
  • 2,218
  • 1
  • 16
  • 17
  • In addition to the .exe, you should also add the .exe.config file if one exists. I eventually got into a situation where some dependencies were missed. Adding the .exe.config file addressed that. – edhubbell Jul 30 '20 at 18:40
  • Same happened to me, after using Primary Output (it was working) had to create a new Installer and just add files from the bin\release folder. Seems so fragile may be happened when VS updated. Haven't got time to go back and prove this stuff – Moon Waxing Mar 03 '21 at 09:19
  • It's probably the 3rd time I've come back to my own answer to see how I've addressed this issue in the past. It's always the same .exe that won't work. This time, I bothered to spend an hour learning Inno Setup instead of an hour banging on Visual Studio. I'm echoing OP @technonaut in the suggestion to just punt and move to Inno Setup. Somebody should downvote my answer and upvote this comment. – edhubbell Nov 04 '21 at 18:31
1

Just to add to what has been said above, I also experienced the same problem, tried everything. I am using visual studio 2019, I was actually getting a warning with no errors: The dependencies for the object 'Microsoft.SqlServer.SqlClrProvider.dll' cannot be determined at the end it said Rebuild All: 2 succeeded, 0 failed. But it did not generate any msi project. What worked for me, was in setup project, Right click, file system, In application folder, delete the problematic dll, then in setup project, Right click on detected Dependencies, refresh dependencies. Rebuild and it works.

John123
  • 17
  • 6