In VS2010, I was using Style Cop 4.3. I added the following key to my app.config so that StyleCop would run with each build.
<Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.3\Microsoft.StyleCop.targets" />-
</Project>
When I upgraded to StyleCop 4.4, I tried to change it to:
<Import Project="$(ProgramFiles)\Microsoft StyleCop 4.4.0.14\Microsoft.StyleCop.dll" />
</Project>
I also changed my project to use version 4 of the Client Framework.
But I get the error:
C:\Program Files\Microsoft StyleCop 4.4.0.14\Microsoft.StyleCop.dll(1,1): The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.
I tried referencing all of the DLLs in that folder, same result.
You’ve changed what you’re importing — from
Microsoft.Stylecop.targetstoMicrosoft.Stylecop.dll. Make sure you’ve gotMSBuild Integrationinstalled and try again.