首页 > 解决方案 > 尝试在 TFS 2015 sp3 中构建解决方案时出错 - 无法弄清楚

问题描述

我们正在使用 VS2019 进行开发,在 On-Prem TFS 2015 service pack 3 中管理所有代码和构建。

遇到了以下 TFS 构建问题,无法弄清楚真正的问题是什么。我验证了解决方案/项目中的 FxCopAnalyzers 是通过 Nuget 安装并签入 TFS。这一切都在我的沙盒工作站上本地构建。TFS 警告声称找不到文件,但它们在那里。非常令人沮丧。

在构建配置 > 进程选项卡中,该解决方案使用默认 v12 构建模板(与 ~50ish 其他构建一样),我已将其设置为作为 CI 构建运行。

我错过了一些东西,但是我已经为此奋斗了很长时间,我认为我有隧道视野。真正的问题可能是什么?任何帮助深表感谢。提前致谢。

CSC: An instance of analyzer Microsoft.CodeAnalysis.VersionCheckAnalyzer.AnalyzerVersionCheckAnalyzer cannot be created from E:\BuildAgentWorking\4\ACTS\ACTS v1.0 SLN (CI)\src\packages\Microsoft.CodeAnalysis.VersionCheckAnalyzer.2.9.8\analyzers\dotnet\Microsoft.CodeAnalysis.VersionCheckAnalyzer.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
 CSC: An instance of analyzer Microsoft.CodeQuality.CSharp.Analyzers.Maintainability.CSharpVariableNamesShouldNotMatchFieldNamesAnalyzer cannot be created from E:\BuildAgentWorking\4\ACTS\ACTS v1.0 SLN (CI)\src\packages\Microsoft.CodeQuality.Analyzers.2.9.8\analyzers\dotnet\cs\Microsoft.CodeQuality.CSharp.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=2.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
 CSC: An instance of analyzer Microsoft.CodeQuality.Analyzers.Maintainability.DoNotIgnoreMethodResultsAnalyzer cannot be created from E:\BuildAgentWorking\4\ACTS\ACTS v1.0 SLN (CI)\src\packages\Microsoft.CodeQuality.Analyzers.2.9.8\analyzers\dotnet\cs\Microsoft.CodeQuality.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=2.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
 CSC: An instance of analyzer Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines.UriPropertiesShouldNotBeStringsAnalyzer cannot be created from E:\BuildAgentWorking\4\ACTS\ACTS v1.0 SLN (CI)\src\packages\Microsoft.CodeQuality.Analyzers.2.9.8\analyzers\dotnet\cs\Microsoft.CodeQuality.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=2.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
 CSC: An instance of analyzer Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines.AbstractTypesShouldNotHaveConstructorsAnalyzer cannot be created from E:\BuildAgentWorking\4\ACTS\ACTS v1.0 SLN (CI)\src\packages\Microsoft.CodeQuality.Analyzers.2.9.8\analyzers\dotnet\cs\Microsoft.CodeQuality.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=2.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..

标签: tfstfsbuild

解决方案


如果您引用了 Microsoft.Net.Compilers 包,请将其更新到最新版本。如果没有,请添加对其最新版本的引用。

如果您的 Microsoft.CodeAnalysis.FxCopAnalyzers 版本对于您的 Visual Studio 版本太高,您可能会收到以下警告:

warning CS8032 ...

要查找支持的最大版本,请参阅此文档:在 Visual Studio 中安装 FxCop 分析器 -> FxCopAnalyzers 包版本


推荐阅读