我的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"
当我使用 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"
有错误:
这是当前 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/