2

I have spent days looking for an answer but have not figured out what happens.

I have a solution with 4 projects. One of them is referenced to other 3. All references are set "copy local = false".

I have made output folders for each of them and everything was going great, until I decided to change the output folder. :-(

Now when I reference the project to another with property "copy local = false" project does not load and I have an error saying

Could not load file or assembly "..." or one of its dependencies. The system cannot find the file specified.

I am quite sure from the FusionLog of the error that Studio is still looking for the project's .dll at the old path.

When I set "copy local = true" projects runs but this solution is not acceptable.

What should I do so I can load my project again with copy local set to false? How can I change the path that Visual Studio is looking? Is there a cache that I can clear or update?

Thanks in advance for any help on this.

RyPope
  • 2,645
  • 27
  • 51

2 Answers2

0

Add this to your dependant project's app.config (I.E. the project that has the dependencies on the other projects):

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <probing privatePath="*relative path to assemblies here*" />
    </assemblyBinding>
</runtime>

With 'relative path to assembly here' replaced with the actual relative paths to where the assemblies are built (your new output folder(s)).

MSDN

Kristian Fenn
  • 867
  • 5
  • 14
0
  1. Take a backup copy of your entire solution (all files)
  2. Locate your solution (.sln) file.
  3. Right click on its icon and select "Open with" and then select NotePad or a similar text editor.
  4. Search for part or all of the old path.
  5. If you find it in the file, replace all instances of the old path with the new path.
  6. Save the file.
Sheridan
  • 68,826
  • 24
  • 143
  • 183