构建服务器正在产生此错误:
The type 'System.Object' is defined in an assembly that is not referenced.
You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Web.Config 包含该配置:
<system.web>
<compilation debug="true" targetFramework="4.5.2">
<assemblies>
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblies>
</compilation>
<httpRuntime targetFramework="4.5.2"/>
</system.web>
我还将 MsBuild 参数更改为
/p:TargetFrameworkVersion=v4.5.2
这没有帮助。还是同样的错误。 我还在构建服务器上看到多个警告:
C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets (990):
The reference assemblies for framework ".NETFramework,Version=v4.5.2" were not found.
To resolve this, install the SDK or Targeting Pack for this framework version or
retarget your application to a version of the framework for which you have the SDK
or Targeting Pack installed. Note that assemblies will be resolved from the Global
Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore
your assembly may not be correctly targeted for the framework you intend.
如何让构建服务器 (Visual Studio Online) 构建此 .Net 4.5.2 项目?
编辑
我也有很多这种类型的警告消息:
C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets (990):
The reference assemblies for framework ".NETFramework,Version=v4.5.2" were not found.
To resolve this, install the SDK or Targeting Pack for this framework version or retarget
your application to a version of the framework for which you have the SDK or Targeting
Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC)
and will be used in place of reference assemblies. Therefore your assembly may not be
correctly targeted for the framework you intend.
最佳答案
Visual Studio Online (VSO) 不支持最新的 .Net Framework。我与 VSO 团队进行了实习生讨论,这是计划在不久的将来进行的。短期解决方案是使用以前的 .Net 框架进行编译,直到 VSO 发布此新功能。
关于.net - Visual Studio Online MsBuild 在 System.Object 上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25375581/