Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can get my VS2010 setup projects to NOT have errors when I open the solution?

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?

like image 763
Johan Avatar asked Jul 20 '11 13:07

Johan


People also ask

How do I see Build errors in Visual Studio?

To display the Error List, choose View > Error List, or press Ctrl+\+E.

What is the code to clean solution in Visual Studio?

Choose Rebuild Solution to "clean" the solution and then build all project files and components. Choose Clean Solution to delete any intermediate and output files. With only the project and component files left, new instances of the intermediate and output files can then be built.


2 Answers

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.

like image 181
Matteo Mosca Avatar answered Oct 11 '22 10:10

Matteo Mosca


Removing the Read-Only attribute on the setup project's source folder fixed it for me.

like image 29
wnutt Avatar answered Oct 11 '22 10:10

wnutt