我已经从nuget包中引用了system.collections.immutable.dll
,并且还为Microsoft.Net.Compilers
安装了nuget包。在本地,一切正常,但是当我将代码推送到Bamboo时,在运行时我得到Could not load file or assembly 'System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
当我检查Bamboo生成工件时的日志时,我可以看到它最初在此处复制了正确的dll:
build 04-Apr-2019 03:20:33 Copying file from "E:\agt01\ENS-EB580-JOB1\Bin\Packages\System.Collections.Immutable.1.5.0\lib\netstandard1.0\System.Collections.Immutable.dll" to "E:\agt01\ENS-EB580-JOB1\Binaries\Release\\temp\Web\_PublishedWebsites\MyService\bin\System.Collections.Immutable.dll".
,但是在某个时候,它用以下代码替换了该dll:
build 04-Apr-2019 03:20:33 Copying file from "E:\agt01\ENS-EB580-JOB1\Bin\Packages\Microsoft.Net.Compilers.1.0.0\tools\System.Collections.Immutable.dll" to "E:\agt01\ENS-EB580-JOB1\Binaries\Release\\temp\Web\_PublishedWebsites\MyService\bin\System.Collections.Immutable.dll".
我如何确保Bamboo不替换此dll,而仅从已安装的nuget软件包中使用它?
更新:更新:我按照以下建议升级了Microsoft.CodeDom.Providers.DotNetCompilerPlatform
nuget软件包:https://github.com/dotnet/roslyn/issues/12255#issuecomment-248588545,但现在我在Bamboo上遇到此错误:
E:\agt01\ENS-EB580-BEQI\TeamBuildTypes\BambooBuild.proj(226,2): error MSB3073: The command "XCOPY "E:\agt01\ENS-EB580-BEQI\..\AWInstaller\Binaries\roslyn\*.*" "E:\agt01\ENS-EB580-BEQI\..\AWInstaller\My Project\Source Program Files\My Release\My Service\bin\roslyn\*.*" /y /e" exited with code 4.