visual-studio - 从 TFS (VSTS) 触发时,VS 2017 .NET 标准类库构建错误

标签 visual-studio msbuild .net-core visual-studio-2017

我的sln是在VS2017中构建的,包含几个.Net Standard类库dll。构建始终在我的本地计算机/虚拟机中成功运行,使用 VS UI 或仅通过命令行使用 devenv.com。

但是,当我使用 TFS 创建构建任务时,显示有关 InternalVisibleTo 的错误。

当我使用 MSBuild 时,

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" "C:\WorkArea\xxxxx\_work\1\s\xxxxx\Main\Source\xxxx.sln" /nologo /nr:false /t:"Clean" /dl:CentralLogger,"C:\WorkArea\xxxxx\tasks\MSBuild\1.0.55\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=30268741-631d-4ac8-b4d2-d5b2774b61e7|SolutionDir=C:\WorkArea\xxxxx\_work\1\s\xxxx\Main\Source"*ForwardingLogger,"C:\WorkArea\xxxxx\tasks\MSBuild\1.0.55\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"  /p:platform="Any CPU" /p:configuration="Debug" /p:_MSDeployUserAgent="TFS_6e1df8d0-1a29-425d-803c-d70779d0c76a_build_3175_345868"

有错误:enter image description here

当我使用 devenv.com 时,

“C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.com”“C:\WorkArea\xxxxxx\_work\1\s\xxxxx\Main\Source\xxxxxx.sln"/build "debug"

有错误:

enter image description here

这是当前 Visual Studio 2017(版本 15.2 - 26430.6)的已知问题或错误吗? AssemlyInfo 有什么问题? TFS 构建有什么问题?

最佳答案

您需要先恢复 NuGet 包,然后再尝试构建以解析对为您提供核心类型的引用程序集的引用。

您可以使用 msbuild/t:Restore (TFS/VSTS:使用 msbuild 任务)或 nuget.exe Restore (使用 nuget.exe >= 4.0 .0).

关于visual-studio - 从 TFS (VSTS) 触发时,VS 2017 .NET 标准类库构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43991605/

相关文章:

c# - 如何在 visual studio 中使用 C# android 创建 android 小部件

wpf - 你能在 WPF 中构建一个像 Visual Studio 一样的 DockPanel

c# - 如何在我的 CI 过程中以及在本地构建时创建 Nuget 包?

visual-studio - MS Deploy任务失败DeploymentBaseOptions不包含UserAgent的定义

visual-studio - 作为构建步骤执行XSLT转换

c++ - 显示同一文档的多个同时 View

visual-studio - 使用新的 IIS Express Web 服务器在 Visual Studio 2010 中进行开发?

visual-studio - Visual Studio 2017 目标框架中未列出 Asp Net Core 2.1

.net - .NET 与 .NET Core 2 的不同 P/Invoke 入口点

c# - EF Core DatabaseGeneratedOption.Computed 不工作