tags:

views:

37

answers:

1

Hi Everybody,

Is there a way to run StyleCopCmd with StyleCop 4.4.*?
I have tried to simply exchange to old stylecop assemblies with the new ones but this leads to an exception that the assembly with the specific version 4.3.0.8 could not be loaded. Is there a hack?

Thanks in advance.

+1  A: 

I have solved the problem by my own.

Here is my solution:

1.) Create a file named StyleCopCmd.exe.config in the StyleCopCmd.exe directory
2.) Make an assembly redirect from version 4.3.0.8 to 4.4.0.14
Configuration File:

<configuration>
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="Microsoft.StyleCop.CSharp" publicKeyToken="31bf3856ad364e35" culture="Neutral" /> 
            <bindingRedirect oldVersion="4.3.0.8" newVersion="4.4.0.14" /> 
        </dependentAssembly>
        <dependentAssembly>
            <assemblyIdentity name="Microsoft.StyleCop.CSharp.Rules" publicKeyToken="31bf3856ad364e35" culture="Neutral" /> 
            <bindingRedirect oldVersion="4.3.0.8" newVersion="4.4.0.14" /> 
        </dependentAssembly>
        <dependentAssembly>
            <assemblyIdentity name="Microsoft.StyleCop" publicKeyToken="31bf3856ad364e35" culture="Neutral" /> 
            <bindingRedirect oldVersion="4.3.0.8" newVersion="4.4.0.14" /> 
        </dependentAssembly>
    </assemblyBinding>
</runtime>

I hope anyone will suck from profit out of it ;-)

Dennis