构建错误:您必须添加对 System.Runtime 的引用 [英] Build error: You must add a reference to System.Runtime

查看:31
本文介绍了构建错误:您必须添加对 System.Runtime 的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在准备一个全新的 ASP.NET MVC 5.1 解决方案.我正在添加一堆 NuGet 包并使用 Zurb Foundation 等进行设置.

I'm preparing a brand new ASP.NET MVC 5.1 solution. I'm adding in a bunch of NuGet packages and setting it up with Zurb Foundation, etc.

作为其中的一部分,我添加了对内部 NuGet 包的引用,该包是可移植类库,我认为这会导致构建服务器出现问题.

As part of that, I've added a reference to an in-house NuGet package which is a Portable Class Library and I think this is causing a problem on the build server.

TeamCity 构建失败:

TeamCity fails the build with:

类型System.Object"是在未引用的程序集中定义的.您必须添加对程序集System.Runtime, Version=4.0.0.0

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

我最初在编译 Razor 网页时添加了针对相同或类似错误的修复程序,该修复程序位于 web.config

I originally added the fix for the same or similar error when compiling the Razor web pages, that fix being in the web.config

<compilation ... >
  <assemblies>
    <add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </assemblies>
</compilation>

但是,问题没有解决.

推荐答案

添加对此 System.Runtime.dll 程序集的引用修复了该问题:

Adding a reference to this System.Runtime.dll assembly fixed the issue:

C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETFrameworkv4.5.1FacadesSystem.Runtime.dll

虽然该显式路径中的文件在构建服务器上不存在.

Though that file in that explicit path doesn't exist on the build server.

一旦我找到了一些关于 PCL 和这些 Facades 的文档,我会发回更多信息.

I will post back with more information once I've found some documentation on PCL and these Facades.

更新

是的,整个互联网上的外观组件几乎没有.

Yeah pretty much nothing on facade assemblies on the whole internet.

谷歌:

(Facades OR Facade) Portable Library site:microsoft.com

这篇关于构建错误:您必须添加对 System.Runtime 的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆