I recently had to move my hudson build server. In doing so, i installed the latest version of Stylecop (4.7) and MSBuild Extension Pack. They don't seem to work together. When executing the following in MSBuild:
<MSBuild.ExtensionPack.CodeQuality.StyleCop
TaskAction="Scan"
ShowOutput="true"
ForceFullAnalysis="true"
CacheResults="false"
LogFile="$(ResultsDir)\StyleCopLog.txt"
SettingsFile="E:\Program Files\StyleCop 4.7\Settings.StyleCop"
SourceFiles="@(StyleCopFiles)"
>
<Output TaskParameter="Succeeded" PropertyName="AllPassed"/>
<Output TaskParameter="ViolationCount" PropertyName="Violations"/>
<Output TaskParameter="FailedFiles" ItemName="Failures"/>
</MSBuild.ExtensionPack.CodeQuality.StyleCop>
I get the following error:
error : FileNotFoundException: Could not load file or assembly 'StyleCop, Version=4.7.1000.0, Culture=neutral, PublicKeyToken=f904653c63bc2738' or one of its dependencies. The system cannot find the file specified.
I'm not sure how to fix this. Any suggestions?
Comments: ** Comment from web user: dlindberg **
<MSBuild.ExtensionPack.CodeQuality.StyleCop
TaskAction="Scan"
ShowOutput="true"
ForceFullAnalysis="true"
CacheResults="false"
LogFile="$(ResultsDir)\StyleCopLog.txt"
SettingsFile="E:\Program Files\StyleCop 4.7\Settings.StyleCop"
SourceFiles="@(StyleCopFiles)"
>
<Output TaskParameter="Succeeded" PropertyName="AllPassed"/>
<Output TaskParameter="ViolationCount" PropertyName="Violations"/>
<Output TaskParameter="FailedFiles" ItemName="Failures"/>
</MSBuild.ExtensionPack.CodeQuality.StyleCop>
I get the following error:
error : FileNotFoundException: Could not load file or assembly 'StyleCop, Version=4.7.1000.0, Culture=neutral, PublicKeyToken=f904653c63bc2738' or one of its dependencies. The system cannot find the file specified.
I'm not sure how to fix this. Any suggestions?
Comments: ** Comment from web user: dlindberg **
Great news, there's a simple fix. There is an updated MsBuild.ExtensionPack.StyleCop.dll in the Program Files\StyleCop 4.7 directory. I copied it to the Program Files\MSBuild\ExtensionPack directory and it started working.