I have a solution with a couple of projects. Some(2) of these projects are setup projects. Whenever I open the solution I get errors like the following:
Error 16 Unable to find source file 'Z:...\Remotion.Data.Linq.dll' for assembly 'Remotion.Data.Linq.dll', located in '[TARGETDIR]' Z:...\CirrusNodeServiceSetup.vdproj CirrusNodeServiceSetup
These errors can be made to go away by either doing a build or by 'touching'(with my mouse) the dependencies folders in the setup projects.
Is there any way to make this weird behavior stop?
Yes there's clearly a way. Don't reference libraries from your disk folders or network places.
The right approach is to create a "Dependencies" folder (call it whatever you like) in the same place as where your solution file is. Copy in that folder every external resource and reference it from there.
Then remember to add that new folder and everything you will put in there to your versioning (SVN, HG, etc) so when the sources will be extracted to another machine, all the required dependencies will be there.
EDIT: just to be clear, this applies to libraries that are not part of the net framework, meaning they are not in the GAC. You should always reference CLR libraries from the GAC.