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?
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>
In my case, this error disappeared when I removed System.Collections.Immutable.dll from Bin directory. This DLL is from NuGet package and is available only for Win8 platforms and I was working with Win7. So it might help you too..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With