简体   繁体   English

SonarQube 没有找到 Microsoft.CodeAnalysis 1.3.1.0 但已安装

[英]SonarQube doesnt find Microsoft.CodeAnalysis 1.3.1.0 but it is installed

I have tried to run a SonarQube scan on my C# projects.我试图在我的 C# 项目上运行 SonarQube 扫描。 I have 3 projects and 1 solution file.我有 3 个项目和 1 个解决方案文件。

I run:我跑:

SonarScanner.MSBuild.exe begin /o:"xxxxxxxxx" /k:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"     
/d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="xxxxxxxxxxxxxxxxxxxxxxxxxxx"
MSBuild.exe  Cake.Framework.sln /t:Rebuild
SonarScanner.MSBuild.exe /d:sonar.login="xxxxxxxxxxxxxxxxxxxxxxx" end

Then I see on my cmd:然后我在我的 cmd 上看到:

 SonarScanner for MSBuild 4.10
 Using the .NET Framework version of the Scanner for MSBuild
 Pre-processing started.
 Preparing working directories...
 Updating build integration targets...
 Fetching analysis configuration settings...
 Provisioning analyzer assemblies for cs...
 Installing required Roslyn analyzers...
 Provisioning analyzer assemblies for vbnet...
 Installing required Roslyn analyzers...
 Pre-processing succeeded.

 C:\Users\santi\Desktop\20200422_Cake.Framework-master>MSBuild.exe  Cake.Framework.sln /t:Rebuild
 Microsoft (R) Build Engine, versión 14.0.23107.0

Everything seems fine but suddenly I got like 1000+ warnings like this one:一切似乎都很好,但突然间我收到了 1000 多个这样的警告:

 CSC : warning CS8032: Couldnt create an analyzer instance     
 SonarAnalyzer.Rules.CSharp.PartCreationPolicyShouldBeUsedWithExportAttribute from 
 C:\Users\santi\AppData\Local\Temp\.sonarqube\resources\0\SonarAnalyzer.CSharp.dll : Could not load 
 file or assembly 'Microsoft.CodeAnalysis, version= 1.3.1.0, Culture=neutral,  
 PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file 
 specified. [C:\Users\santi\Desktop\20200422_Cake.Framework-master\Cake.Framework\Cake.Framework.csproj]

I already have installed the Microsoft.CodeAnalysis v 1.3.1 on all my 3 projects using the NuGet Manager.我已经使用 NuGet 管理器在我的所有 3 个项目上安装了 Microsoft.CodeAnalysis v 1.3.1。

What I'm missing?我错过了什么?

I'm using .NET Framework 4.8, MSBuild 14.0, Visual Studio 2019我正在使用 .NET 框架 4.8、MSBuild 14.0、Visual Studio 2019

You don't need to install the code analysis NuGet packages in your projects.您不需要在项目中安装代码分析 NuGet 包。

What matters is the version of the code analysis assemblies that ship with the version of MSBuild you are using to build your solution.重要的是您用于构建解决方案的 MSBuild 版本随附的代码分析程序集的版本。 Check which version of MSBuild you are using ( msbuild -ver ).检查您使用的是哪个版本的 MSBuild ( msbuild -ver )。 It needs to 14.0.25420.1 or later.它需要14.0.25420.1或更高版本。

暂无
暂无

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

相关问题 为什么 Microsoft 分析器找不到 Microsoft.CodeAnalysis? - Why can't Microsoft analyzers find Microsoft.CodeAnalysis? 无法加载文件或程序集“Microsoft.CodeAnalysis,版本= 1.3.1.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”或其依赖项之一 - Could not load file or assembly 'Microsoft.CodeAnalysis, version= 1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependenc 无法加载文件或程序集 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? 如何在 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.FxCopAnalyzers 和 Microsoft.CodeAnalysis 之间有什么区别? - What's the difference between Microsoft.CodeAnalysis.FxCopAnalyzers and Microsoft.CodeAnalysis?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM