Method not found System.Net.Http.Formatting.MediaTypeFormatter.get_SupportedMediaTypes() after adding .NET Standard 2.0 dependency : <p>I have a .NET Framework 4.6.1 WebApi project that is referencing a small NuGet package we use internally to share common utility methods.</p>

<p>We want to start moving some of our stuff to .NET Core, so I changed the utility package to target .NET Standard 2.0. This was done by simply making a new .NET Standard 2.0 project and copying the source files over.</p>

<p>Utility package csproj:</p>

<pre><code>&lt;Project Sdk="Microsoft.NET.Sdk"&gt;

  &lt;PropertyGroup&gt;
    &lt;TargetFramework&gt;netstandard2.0&lt;/TargetFramework&gt;
    &lt;GeneratePackageOnBuild&gt;true&lt;/GeneratePackageOnBuild&gt;
  &lt;/PropertyGroup&gt;

&lt;/Project&gt;
</code></pre>

<p>After updating the package in my WebApi project, I get the following exception on startup:</p>

<pre><code>[MissingMethodException: Method not found: 'System.Collections.ObjectModel.Collection`1&lt;System.Net.Http.Headers.MediaTypeHeaderValue&gt; System.Net.Http.Formatting.MediaTypeFormatter.get_SupportedMediaTypes()'.]
   MyWebApiProject.Application.InitializeHttpConfiguration(HttpConfiguration config) in C:\MyWebApiProject\Global.asax.cs:44
   System.Web.Http.GlobalConfiguration.Configure(Action`1 configurationCallback) +34
   MyWebApiProject.Application.OnApplicationStarted() in C:\MyWebApiProject\Global.asax.cs:62
   Ninject.Web.Common.NinjectHttpApplication.Application_Start() +183

[HttpException (0x80004005): Method not found: 'System.Collections.ObjectModel.Collection`1&lt;System.Net.Http.Headers.MediaTypeHeaderValue&gt; System.Net.Http.Formatting.MediaTypeFormatter.get_SupportedMediaTypes()'.]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +10104513
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +173
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): Method not found: 'System.Collections.ObjectModel.Collection`1&lt;System.Net.Http.Headers.MediaTypeHeaderValue&gt; System.Net.Http.Formatting.MediaTypeFormatter.get_SupportedMediaTypes()'.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10085804
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
</code></pre>

<p>The only changes are the version number in packages.config and the csproj.</p>

<p>Any ideas?</p>

<p>Thanks!</p>
