0

我的项目在 Visual Studio 中构建良好,并在我的机器上使用 MSBUILD。但是,在构建代理上,如果我运行 MSBUILD,则会收到以下错误。我已经尝试指定 4.0 的目标框架但没有成功。还有其他想法吗?

"c:\Test\Test.csproj" (default target) (6) ->
(CoreCompile target) ->
  ItemSearchDelegate.cs(17,10): error CS0433: The type 'System.Action<T1,T2>' exists in both 'c:\Windows\Microsoft.NET\
Framework\v4.0.30319\mscorlib.dll' and 'c:\Windows\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.
dll'

我发现最有趣的是:MSBUILD 错误上方的一些行,我看到:

 CSC : warning CS1685: The predefined type 'System.Action' is defined in multiple assemblies in the global alias; using definition from 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll' 

所以它决定使用 v4 只是为了稍后抱怨?

我所做的只是:在 .CSPROJ 文件所在的位置打开命令行并运行“msbuild”。没有什么花哨。

4

0 回答 0