如何在Resharper命令行或“ InspectCode”中使用StyleCop插件。工具 [英] How to use the StyleCop Plugin with the Resharper command line or "InspectCode" tool

查看:169
本文介绍了如何在Resharper命令行或“ InspectCode”中使用StyleCop插件。工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们将Resharper与StyleCop插件一起使用。它在Visual Studio中运行良好,没有任何问题。

We use Resharper with the StyleCop plugin. It works great inside Visual Studio without any problems.

现在,我想获取有关我们项目的统计信息。我正在从命令行构建所有解决方案,到目前为止,我们设法从编译器(警告)静态代码分析(例如FxCop)和单元测试(结果和覆盖范围)中获取输出。

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提供了一个命令行工具,可免费进行代码分析(链接)。

JetBrains offers a commandline tool that does code analysis for free (Link).

我正在使用它如预期般运作。

I'm using it and it works as expected.

命令行版本无法识别我的StyleCop插件,这是规则。很明显,这是一个不同的文件夹。所以我将插件文件夹复制到

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


C:\Program Files(x86)\JetBrains\ReSharper\v8.2\ \Bin\插件\ StyleCop 4.7

C:\Program Files (x86)\JetBrains\ReSharper\v8.2\Bin\Plugins\StyleCop 4.7

从我的Resharper安装转到命令行工具的 。\ \Bin\Plugins\StyleCop 4.7 ,它可以工作...命令行工具可以识别并加载插件。但是,插件然后找不到StyleCop程序集。它们默认安装在

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

C:\Program Files (x86)\StyleCop 4.7

Visual Studio中的Resharper本身可以以某种方式自动检测到它们。

Resharper itself in Visual Studio can somehow auto-detect them.

我尝试将StyleCop程序集复制到命令行exe所在的文件夹中。没有任何更改。

I tried copying the StyleCop assemblies to the same folder that the commandline exe is in. Nothing changed.

我尝试将StyleCop程序集复制到StyleCop插件程序集旁边。那在某种程度上起作用了。 StyleCop插件发现它是StyleCop程序集,但是命令行工具抱怨,因为它试图将该文件夹中的每个程序集都作为插件加载。

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.

那我该怎么办?是否可以使用命令行工具与StyleCop插件配合使用?

如果有更好的选择,我确实拥有完整的许可证,对此我感到高兴只要我可以从批处理文件启动它而不必打开Visual Studio GUI,任何提示都可以使用免费的命令行工具或正常的Resharper完整版进行。

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.

推荐答案

当前状态


Resharper意识到这是其工具存在的问题。问题编号为 RSRP-436208

2017.1.1 起它尚未修复。

使用Nuget软件包时(扩展名 .nupkg )位于该工具的文件夹中,它会在某个临时位置自动展开。

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 插件均应正常工作。

So any *.nupkg of a plugin that resides in the tool folder should work.

这篇关于如何在Resharper命令行或“ InspectCode”中使用StyleCop插件。工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆