TeamCity 构建失败

TeamCity build failing

我有一个 Web api 项目,当我将 .net Framework (4.71) class 库添加到解决方案时,该项目不会构建在 teamcity 上。如果我删除 class 库,构建就会成功。

[CoreCompile] Csc [12:03:15][Csc] C:\Program Files (x86)\Microsoft Visual Studio17\BuildTools\MSBuild.0\bin\Roslyn\csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.1\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.1\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.1\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.1\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.1\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.1\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.1\System.Net.Http.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.1\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.1\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\SomeClassLib.dll /subsystemversion:6.00 /target:library /utf8output /deterministic+ Class1.cs Properties\AssemblyInfo.cs "C:\TeamCity\buildAgent2\temp\buildTmp.NETFramework,Version=v4.7.1.AssemblyAttributes.cs" [12:03:15][Csc] Using shared compilation with compiler from directory: C:\Program Files (x86)\Microsoft Visual Studio17\BuildTools\MSBuild.0\bin\Roslyn [12:03:15][Csc] CSC error CS0041: Unexpected error writing debug information -- 'Unable to load DLL 'Microsoft.DiaSymReader.Native.amd64.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)'

发现问题。我在文本编辑器中编辑了我的项目文件,并删除了 Deterministic 元素。之后构建成功。

<PropertyGroup>
  <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
  <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
  <ProjectGuid>{GUID}</ProjectGuid>
  <OutputType>Library</OutputType>
  <AppDesignerFolder>Properties</AppDesignerFolder>
  <RootNamespace>RootNS</RootNamespace>
  <AssemblyName>RootNS</AssemblyName>
  <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
  <FileAlignment>512</FileAlignment>
  <Deterministic>true</Deterministic> <!--removed this line-->
  <SccProjectName>SAK</SccProjectName>
  <SccLocalPath>SAK</SccLocalPath>
  <SccAuxPath>SAK</SccAuxPath>
  <SccProvider>SAK</SccProvider>
</PropertyGroup>