title: The type 'Object' is defined in an assembly that is not ref
body: <p>I know this error is common but I couldn't find any SO question to solve my problem .</p>
  
  <p>I have this piece of code : </p>
  
  <pre><code>    public static T _download_serialized_json_data&lt;T&gt;(string url) where T : new()
      {
              //This Line raise the error
              JsonConvert.ToObject(await new HttpClient().GetStringAsync(url));
              }
              catch (Exception) { }
              //This line raise a second error(same as the first one)
              return !string.IsNullOrEmpty(json_data) ? JsonConvert.DeserializeObject&lt;T&gt;(json_data) : new T();
       }
  </code></pre>
  
  <p>I'm getting an error regarding the first and last lines of my code </p>
  
  <blockquote>
    <p>Error   CS0012  The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.</p>
  </blockquote>
  
  <p>As if JsonConvert doesn't contain a definition for ToObject and DeserializeObject . I don't understand which reference am I missing . The wierd thing is, if I add another class on a different page, and add this method there with the same <code>using</code> , no error appears . </p>
  
  <p>My csproj :</p>
  
  <pre><code>  &lt;PropertyGroup&gt;
    &lt;TargetFramework&gt;netstandard2.1&lt;/TargetFramework&gt;
    &lt;/PropertyGroup&gt;
    &lt;PropertyGroup&gt;
      &lt;PackageTargetFallback&gt;$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;&lt;/PackageTargetFallback&gt;
    &lt;/PropertyGroup&gt;
    &lt;ItemGroup&gt;
      &lt;PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" /&gt;
      &lt;PackageReference Include="Microsoft.AspNetCore" Version="2.1.2" /&gt;
      &lt;PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.1" /&gt;
      &lt;PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.1" /&gt;
      &lt;PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.1.1" /&gt;
      &lt;PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Ver sion="2.1.1" /&gt;
      &lt;PackageReference Include="Newtonsoft.Json" Version="11.0.2" /&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.1" /&gt;
    &lt;/ItemGroup&gt;
  </code></pre>