某些项目的依赖项包含无法解释的代码分析器 [英] Some projects' dependencies contain unexplained code analyzers
问题描述
我有几个项目,在 Dependencies
下有一个或两个这样的代码分析器分支:
我按照
我不知道它们来自哪里.有些项目有它们,有些则没有.但是,它们似乎与安装在这些项目中的 ASP.NET Core
或 MVC
包有关.
我通过删除 microsoft.codeanalysis.analyzers
文件夹并执行 nuget restore
修复了警告.它们仍然在 Dependencies
下,但至少感叹号消失了.
我还通过将 <ExcludeAssets>analyzers</ExcludeAssets>
directive 添加到每个 AspNetCore
包中,设法删除了分析器:
<ExcludeAssets>分析器</ExcludeAssets></PackageReference><PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" 版本="2.1.1" ><ExcludeAssets>分析器</ExcludeAssets></PackageReference>
现在他们终于走了.
I have a couple of projects where under Dependencies
there are one or two branches of code analyzers like this:
I tried the right mouse click on every branch as explaind here but there is no option to configure them and I also searched for *.ruleset
files insinde the solution, I also check the packages as shown in the docs but there is nothing like that anywhere.
There is also nothing suspicious in the .csproj
files, just some nuget packages that I've installed but nothing analyzer related.
How do I get rid of them? They give me warnings when I reference such projects in other solutions and nuget restore
doesn't fix it either:
I have no idea where they come from. Some projects have them and others don't. However, they seem to somehow be related to ASP.NET Core
or MVC
packages that are installed in those projects.
I've fixed the warnings by deleting the microsoft.codeanalysis.analyzers
folder and executing nuget restore
. They are still under Dependencies
but at least the exclamation marks are gone.
I've also managed to remove the analyzers by adding the <ExcludeAssets>analyzers</ExcludeAssets>
directive to each AspNetCore
package:
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.3">
<ExcludeAssets>analyzers</ExcludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.1.1" >
<ExcludeAssets>analyzers</ExcludeAssets>
</PackageReference>
Now they're finally gone.
这篇关于某些项目的依赖项包含无法解释的代码分析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!