This project has moved and is read-only. For the latest updates, please go here.

System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly

Jan 5, 2014 at 10:54 AM
I'm getting this error for the following ....
AspNetAuthorizer auth;
TwitterContext twitterCtx;
Error 1 The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. C:\Users\GPD\Documents\Visual Studio 2010\WebSites\TCOT\MasterPage.master.cs 12 19 C:...\TCOT\
Jan 6, 2014 at 6:12 AM

You need .NET 4.5 or later for v3.0. You can use v2.1.11 with earlier versions.

Mar 29, 2014 at 9:10 AM
I am using .Net 4.5 and get the same error. There is no System.Runtime if I try to add a reference in my project.
Mar 30, 2014 at 5:17 AM

If I recall, the closest I came to reproducing this was with an ASP.NET with a 4.0 profile, which is what prompted the previous recommendation to ensure working with a 4.5 or later profile. If that isn't the problem then I don't know unless I can reproduce the problem.

That said, here's the approach I would take if my project was producing the error you're seeing. The downloadable source code has a project named Linq2TwitterDemos_AspNet. If that runs for you, then you can use that to find the diff between that the project you're having problems with.

Jun 2, 2014 at 4:31 PM
I had the same problem in my ASP.NET MVC project, this was the solution:

Change the following line in web.config:
<compilation debug="true" targetFramework="4.5"/>
<compilation debug="true" targetFramework="4.5">
  <add assembly="System.Runtime, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />  
Marked as answer by JoeMayo on 6/2/2014 at 9:09 PM