【问题标题】:RedundantNameQualifier error when Running Resharper CLI inspect tool运行 Resharper CLI 检查工具时出现 RedundantNameQualifier 错误
【发布时间】:2019-01-19 03:10:42
【问题描述】:

我在我创建的 dotnet core 2.1 控制台应用程序上使用 Resharper 检查 CLI 工具进行静态代码分析 (JetBrains.ReSharper.CommandLineTools.2018.3.1\InspectCode.exe)。在解决方案中,有一个单独的项目,它只是控制台应用程序中使用的一个包。

布局如下:

当我按如下方式运行 inspectCode.exe 时:

JetBrains.ReSharper.CommandLineTools.2018.3.1\InspectCode.exe "AI.DL.Backup\AI.DL.Backup.csproj" /o:"CodeInspection_20222.xml" /profile:"AI.DL.Backup.sln.DotSettings"

我遇到以下问题:

输出xml报告有以下内容:

<IssueType WikiUrl="https://www.jetbrains.com/resharperplatform/help?Keyword=RedundantNameQualifier" Severity="WARNING" Description="Redundant name qualifier" CategoryId="CodeRedundancy" Category="Redundancies in Code" Id="RedundantNameQualifier"/>

<Issue Message="Qualifier is redundant" Line="5" Offset="146-154" File="AI.DL.Backup\src\AI.DL.Backup\Startup.cs" TypeId="RedundantNameQualifier"/>

问题似乎是它找不到引用的 dll 项目并抛出代码分析错误(代码已经构建,因此 bin/obj 文件夹存在需要相关的 dll/包)。

Ling 5(如指定)只是单独包的 using 语句,它无法解析并且被认为是多余的。

using AI.DL.DocumentManagement;
using AI.DL.DocumentManagement.Stores;

通过生成的 XML 报告,我可以看到它在单独的包中找不到命名空间。为什么会这样?有人见过这个吗?

【问题讨论】:

  • 如果您在解决方案文件上调用该工具,指定您要分析的项目,它是否有效? JetBrains.ReSharper.CommandLineTools.2018.3.1\InspectCode.exe --project="AI.DL.Backup" --profile="AI.DL.Backup.sln.DotSettings" --output="CodeInspection_20222.xml" "AI.DL.Backup.sln"

标签: .net-core console-application resharper static-code-analysis .net-core-2.0


【解决方案1】:

当我将“inspect.exe”重新指向我的解决方案文件而不是单个项目时,我能够解决这个问题!

【讨论】:

    猜你喜欢
    • 2016-12-09
    • 1970-01-01
    • 1970-01-01
    • 2011-04-15
    • 2019-04-26
    • 1970-01-01
    • 2021-12-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多