Compilation error at runtime from Microsoft.AspNet.WebApi.HelpPage version 4.0.30506

asp.net, asp.net-mvc, razor

Solution

check your web.config:

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

Problem

I am getting the following error when I try to use version 4.0.30506 (unfortunately we are tied to this version of ASP.NEt Web API for now) of the Microsoft.AspNet.WebApi.HelpPage nuget package. I am using Windows 7 and .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: ``` As far as I can see I have all the correct references for this to work. I have tried looking for a System.Runtime assembly as it suggests, but I can't find it on my system. I have added using statements to the top of Index.cshtml, but with no affect. ``` @using System @using System.Runtime ``` Any suggestions of what is causing this error?

Original source

Related problems