So I have an odd issue today that’s worth noting. First I had an issue where a style could not be found. I fixed the issue but still had the same exception saying the style could not be found. After a lot of checking we realised the Silverlight project that was being loaded as the main app was not attaching the debugger. We check the web projects properties and ensured that the Silverlight Application was added with debugging enabled under Silverlight Applications and the web project had the Silverlight Debugger enabled under Web but we still had the same issue.
Previously I made the mistake of checking in the xap file of the Silverlight app that is created in the ClientBin folder of the web project. This caused the tfs build to fail because it seems like tfs generates these when you do the build. Cutting things short the fact that I checked the xap in caused all my issues. The check-in process marks the xap as read only which could have caused the TFS Build to fail. But it also caused my local build to fail but without any obvious errors. Instead of failing it was using an old copy of the xap which didn’t contain the style fix or the debugging symbols.
Lesson learnt do not check-in your xap files located in the ClientBin folder of the web project.