Search code examples
visual-studio-2010referencenamespacessilverlight-5.0solution

Why does my Visual Studio 2010 Silverlight solution completely break on "Clean"?


Previous to cleaning, everything built correctly, and I was able to make significant changes/rebuild throughout the day. I decided to "Clean Solution" and that promptly broke everything. Any reference to namespaces could not be found, as seen in the error below:

The type or namespace name '(insert_name)' could not be found (are you missing a using directive or an assembly reference?

In this solution, it accounted for 631 errors. No rebuilding/building combination seemed to fix it. I had difficulty finding much about this online, so thought I'd post here to see if anyone had some idea.

It may also be worth noting that this solution was simply copied to my machine from a coworker's, so it may have something to do with that? Although, it built perfectly fine previous to cleaning. Thoughts?


Solution

  • I see the following possibilities:

    • you have some references to libraries that use an absolute path that is valid on one machine and not another. For instance, you use Silverlight Toolkit and it's not installed on both machines, or one of the computers is 32 bits and the other 64 bits, and you get Program Files (x86) on the x64 only.

    • you have some references to libraries that use a relative path that is valid on one machine and not another. For instance you have X:\Work\Project\Project.sln which references X:\Work\Tools\Library.dll using ..\..\Tools\Library.dll, and the other machine has it in X:\Work\Tools\SomeLib\Library.dll.

    In both cases, you should see a 'root' error indicating a library's DLL wasn't found. Sometimes, looking at the Output window instead of the Errors window makes it easier to spot.