【发布时间】:2013-12-05 10:34:29
【问题描述】:
当我尝试使用 Microsoft.AspNet.WebApi.HelpPage nuget 包的 4.0.30506 版(不幸的是,我们目前与此版本的 ASP.NEt Web API 相关联)时出现以下错误。我正在使用 Windows 7 和 .NET 4.5。
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 语句,但没有任何影响。
@using System
@using System.Runtime
关于导致此错误的任何建议?
【问题讨论】:
标签: asp.net asp.net-mvc razor