I hate it when the Internet doesnâ€™t know the answer â€“ and doesnâ€™t even have the question â€“ to a problem Iâ€™m experiencing.
Because it was released during the MVP Summit, I was able to download the Visual Studio 11 Beta and run it on a VS2010 project.
Thereâ€™s no â€śconversion wizardâ€ť, which bodes well, because it suggests that I will be able to use this project in either environment (Visual Studio 2010 or the new VS11 beta) without any problems. And certainly, the project I selected to try worked just fine in Visual Studio 11 and when I switched back to Visual Studio 2010.
Unfortunately, one of the things that I noticed when building my project is that the code analysis phase crapped out with fourteen instances of the CA0053 error:
As you can see, this is all about being unable to load rule assemblies from the previous version of Visual Studio â€“ and is more than likely related to me installing the x64 version of Visual Studio 11 Beta, which therefore canâ€™t load the 32-bit (x86) DLLs from Visual Studio 2010.
Curiously this problem only exists on one of the projects in my multi-project solution, and of course I couldnâ€™t find anywhere in the user interface to reset this path.
I thought for a moment I had hit on something when I checked the projectâ€™s options, and found the Code Analysis tab, but it didnâ€™t seem to matter what I did to change the rule set, there was no place to select the path to that rule set.
Then I decided to go searching for the path in the source tree.
There it was, in the projectâ€™s â€ś.csprojâ€ť file â€“ two entries in the XML file, CodeAnalysisRuleSetDirectories and CodeAnalysisRuleDirectories. These consisted of the simple text:
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
As you can imagine, I wouldnâ€™t normally suggest editing files by hand that the interface normally takes care of for you, but itâ€™s clear that in this case, the interface wasnâ€™t helping.
So, I just closed all currently open copies of Visual Studio (all versions), and edited the file in notepad. I kept the entries themselves, but deleted the paths:
Errors gone; problem solved.
Youâ€™re welcome, Internet.