We use Resharper with the StyleCop plugin. It works great inside Visual Studio without any problems.
Now I'd like to get statistics about our projects. I am building all our solutions from the command line and so far managed to get the output from the compiler (warnings) static code analysis (ex FxCop) and unit testing (results and coverage).
JetBrains offers a commandline tool that does code analysis for free (<a href="http://blog.jetbrains.com/dotnet/2013/03/26/resharper-code-analysis-goes-beyond-visual-studio/" rel="nofollow">Link</a>).
I'm using it and it works as expected.
The command line version does not recognize my StyleCop plugin and it's rules. That's obvious, it's a different folder. So I copied my plugins folder at<blockquote>
C:\Program Files (x86)\JetBrains\ReSharper\v8.2\Bin\Plugins\StyleCop 4.7</blockquote>
over from my Resharper installation into the command line tool's
.\Bin\Plugins\StyleCop 4.7 and it works... the command line tool recognizes the plugin and loads it. However, the plugin then cannot find the StyleCop assemblies. They were default-installed into
C:\Program Files (x86)\StyleCop 4.7</blockquote>
Resharper itself in Visual Studio can somehow auto-detect them.
I tried copying the StyleCop assemblies to the same folder that the commandline exe is in. Nothing changed.
I tried copying the StyleCop assemblies next to the StyleCop Plugin assembly. That worked in a way. The StyleCop plugin found it's StyleCop assemblies, but the command line tool complained because it tried to load every single assembly in that folder as plugin.
<strong>So how do I get the command line tool to work with the StyleCop plugin?</strong>
If there is a better option, I do have a full license, I'm happy about any hint how to do this with the free command line tool or the normal Resharper full version as long as I can start it from a batch file without having to open the Visual Studio GUI.Answer1:
Resharper recognized this is a problem with their tool. The Issue # is <a href="https://youtrack.jetbrains.com/issue/RSRP-436208" rel="nofollow">RSRP-436208</a>.
It's not fixed as of
When a Nuget package ( extension
.nupkg ) is found in the tool's folder, it is expanded automatically in some temporary location. It's assemblies are then used with the tool.
*.nupkg of a plugin that resides in the tool folder should work.