Question

I have a large solution containing many C# projects. When I open the solution and hit F5 for the first time, I get compile errors like the following:

Error 3 Metadata file 'C:\Users\david\Documents\VS.Projects\CeoTrunk\Ceoimage\bin\x86\Release\Ceoimage.dll' could not be found.

I'm compiling the solution and the projects producing the error for "Debug (Any CPU)" and I haven't selected "Release (x86)" for a long time. Maybe months. These errors go away after I build the solution for "Debug (Any CPU)" the first time. If I close the solution and hit F5 again, the problem reappears.

Where could this "Release (x86)" remnant be hiding? How do I get rid of it? Why does it keep coming back?

Was it helpful?

Solution

Without seeing your solution and project files, here is what I suggest.

  1. Clean out ALL obj and bin directories (preferrably, delete your source and get a fresh copy).
  2. Try a full build and see if it still fails. If it does...
  3. Repeat step 1.
  4. Check your references for each project and make sure they reference other projects as project references rather than a direct reference to their output assembly.
  5. Try unloading projects and rebuilding to see if you can identify the offending item.

Unfortunately, it could come down to a cyclic dependency or some other convoluted dependency tree that means Visual Studio is struggling to determine a valid build order, hence requiring multiple builds to complete the process.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top