Friday, 21 May 2010

Dependency error on Visual Studio 2010 Setup project

Since I moved to Visual Studio 2010, I have had several issues with Setup Projects. They convert from 2008 just fine, but I have detected some misbehaviors, specially related to DLL dependencies.

This morning, I came to a situation where Visual Studio always detected a DLL dependency which should not exist anymore. I tried marking the dependency as non-vital, excluding it. Nothing worked. My EXE file no longer depends on that DLL, but it was still there, and as it was an automatically detected dependency, I could not delete it. I tried even to set the DLL in the proper location (where Visual Studio was supposedly searching for it), but it didn’t work either. Visual Studio was still complaining about DLL not found.

The only thing that seemed to work momentarily was re-adding the EXE file that supposedly was dependant on that DLL. That fixed the DLL not found errors, but then appeared another one: “Unable to update the dependencies of the project”.

Searching a bit about this last message, I’ve found this post talking about garbage in project’s dependencies. Clayton James explains how to get rid of that error, cleaning the project by yourself in notepad. I found that information very useful.

However, in my specific case, it was not necessary to wipe all the Hierarchy and Files nodes (what wipes your solution too, making you to re-add all your files to your setup project). In my case it was enough with removing the references to the conflicting DLL from the Files section. That made the trick.

Hope it helps.

No comments: