首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >来自Microsoft.AspNet.WebApi.HelpPage版本4.0.30506的运行时编译错误

来自Microsoft.AspNet.WebApi.HelpPage版本4.0.30506的运行时编译错误
EN

Stack Overflow用户
提问于 2013-12-05 18:34:30
回答 1查看 6.5K关注 0票数 20

当我尝试使用4.0.30506版的Microsoft.AspNet.WebApi.HelpPage nuget包(不幸的是,我们现在绑定到这个版本的nuget包)时,我得到了以下错误。我使用的是Windows7和.NET 4.5。

代码语言:javascript
复制
Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS0012: 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'.

Source Error:


Line 11: 
Line 12:     // Group APIs by controller
Line 13:     ILookup<string, ApiDescription> apiGroups = Model.ToLookup(api => api.ActionDescriptor.ControllerDescriptor.ControllerName);
Line 14: }
Line 15: 

据我所知,我有所有正确的参考资料。我试着按照提示查找System.Runtime程序集,但在我的系统上找不到它。我已经在Index.cshtml的顶部添加了using语句,但没有任何影响。

代码语言:javascript
复制
@using System
@using System.Runtime

有什么建议是导致这个错误的吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-12-05 18:39:16

检查您的web.config:

代码语言:javascript
复制
<compilation debug="true" targetFramework="4.5">
    <assemblies>
        <add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </assemblies>
</compilation>
票数 28
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20397623

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档