简体   繁体   English

Microsoft.CodeAnalysis.FxCopAnalyzers 和 Microsoft.CodeAnalysis 之间有什么区别?

[英]What's the difference between Microsoft.CodeAnalysis.FxCopAnalyzers and Microsoft.CodeAnalysis?

I want to install code analysis in one of my C# projects, and it seems that the way people add code analysis to .NET Core projects is by using the NuGet package Microsoft.CodeAnalysis.FxCopAnalyzers .我想在我的一个 C# 项目中安装代码分析,似乎人们将代码分析添加到 .NET Core 项目的方式是使用 NuGet 包Microsoft.CodeAnalysis.FxCopAnalyzers

However, I also found other NuGet packages from the Microsoft.CodeAnalysis namespace, namely Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.CodeAnalysis.Features , etc.但是,我还从Microsoft.CodeAnalysis命名空间中找到了其他 NuGet 包,即Microsoft.CodeAnalysisMicrosoft.CodeAnalysis.CSharpMicrosoft.CodeAnalysis.Features等。

What is the purpose of these other packages in comparison to the FxCopAnalyers package?FxCopAnalyers包相比,这些其他包的用途是什么? The package descriptions are not very clear, so I don't know what their use cases are.包的描述不是很清楚,所以我不知道他们的用例是什么。

EDIT 2021: From current documentation : Prior to Visual Studio 2019 16.8 and .NET 5.0, code analyzers shipped as Microsoft.CodeAnalysis.FxCopAnalyzers NuGet package.编辑 2021:根据当前文档:在 Visual Studio 2019 16.8 和 .NET 5.0 之前,代码分析器作为Microsoft.CodeAnalysis.FxCopAnalyzers NuGet 包提供。 Starting in Visual Studio 2019 16.8 and .NET 5.0, these analyzers are included with the .NET SDK.从 Visual Studio 2019 16.8 和 .NET 5.0 开始,这些分析器包含在 .NET SDK 中。 They are also available as Microsoft.CodeAnalysis.NetAnalyzers NuGet package.它们也可用作Microsoft.CodeAnalysis.NetAnalyzers NuGet 包。 Please consider migrating from FxCop analyzers to .NET analyzers.请考虑从 FxCop 分析器迁移到 .NET 分析器。

Microsoft.CodeAnalysis.FxCopAnalyzers is just a set of analyzers which analyze your code as some other analyzers, IDEs, etc. This package analyzes your code for performance, design issues, and so on, and so forth. Microsoft.CodeAnalysis.FxCopAnalyzers只是一组分析器,可以像其他一些分析器、IDE 等一样分析您的代码。此包分析您的代码的性能、设计问题等。

However, Microsoft.CodeAnalysis.CSharp , Microsoft.CodeAnalysis.VisualBasic , Microsoft.CodeAnalysis.Workspaces and other similar packages allow you to programmatically analyze input code, write custom static code analyzers and rulesets, investigate semantic and syntactical code models, and use some helpful logic to extend Visual Studio features, and so on, and so forth.但是, Microsoft.CodeAnalysis.CSharpMicrosoft.CodeAnalysis.VisualBasicMicrosoft.CodeAnalysis.Workspaces和其他类似包允许您以编程方式分析输入代码、编写自定义静态代码分析器和规则集、研究语义和句法代码模型,并使用一些有用的用于扩展 Visual Studio 功能的逻辑等等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Roslyn的新版本(Microsoft.CodeAnalysis)中,`Solution.LoadStandAloneProject`发生了什么? - What happened to `Solution.LoadStandAloneProject` in Roslyn's new version (Microsoft.CodeAnalysis)? 无法加载文件或程序集 Microsoft.CodeAnalysis - Could not load file or assembly Microsoft.CodeAnalysis 在Roslyn与Microsoft.CodeAnalysis中添加MetadataReference - Adding MetadataReference in Roslyn Vs Microsoft.CodeAnalysis Microsoft.CodeAnalysis无法加载文件 - Microsoft.CodeAnalysis failed to load file 在哪里阅读Microsoft.CodeAnalysis的文档? - Where to read docs for Microsoft.CodeAnalysis? 为什么 Microsoft 分析器找不到 Microsoft.CodeAnalysis? - Why can't Microsoft analyzers find Microsoft.CodeAnalysis? 如何在 memory 中编译并使用 Microsoft.CodeAnalysis 获取程序集 - How to compile in memory and get assembly using Microsoft.CodeAnalysis Microsoft.CodeAnalysis:使用Newtonsoft JObject编译动态代码时出错 - Microsoft.CodeAnalysis: Error compiling dynamic code with Newtonsoft JObject 使用Roslyn(Microsoft.CodeAnalysis)查询WebSite项目的信息 - Using Roslyn (Microsoft.CodeAnalysis) to query information of WebSite projects 如何使用 Microsoft.CodeAnalysis(或类似)获取项目(.csproj)的目标框架? - How to get the Target Framework/s of a project (.csproj) using Microsoft.CodeAnalysis (or similar)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM