From where do I reference a missing assembly (System.Net.Http.Formatting)?

system.net.http.formatting .net core
found conflicts between different versions of system net http formatting that could not be resolved
assembly for system net http
system.web.http missing
system.net.http.formatting gac
system.web.http.webhost missing
could not load file or assembly http formatting
system web http odata missing

In my Visual Studio 2013 RC project, I'm getting this err msg:

"The type 'System.Net.Http.Formatting.MediaTypeFormatter' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'"

...on the "var response = " line of code in a Controller:

public HttpResponseMessage PostDelivery(Delivery delivery)
{
    delivery = repository.Add(delivery);
    var response = Request.CreateResponse<Delivery>(HttpStatusCode.Created, delivery);

    string uri = Url.Link("DefaultApi", new { id = delivery.Id });
    response.Headers.Location = new Uri(uri);
    return response;
}

Searching my hard drive for the required assembly ("System.Net.Http.Formatting"), it shows me several locations where it exists, but they are all within existing projects, as is seen here:

Surely there is another location from which System.Net.Http.Formatting.dll can be referenced! But where?

UPDATE

Trying to follow the clue here: http://www.nuget.org/packages/System.Net.Http.Formatting

IOW, by selecting Tools > Library Package Manager > Package Manager Console, and entering:

Install-Package System.Net.Http.Formatting -Version 4.0.20710

...I see the red bulls of Pamplona (not the beverage) descending wild-eyed upon me:

UPDATE 2

I added the System.Net.Http.Formatting.dll from here:

C:\Users\clay\My Documents\Visual Studio 2013\Projects\MvcApplication1\MvcApplication1\bin

...and it now compiles and runs and works as expected, but that is obviously "not the preferred method"


I had the same problem. I used Microsoft Asp Net WebApi Client 4.0.20710 and it worked for me.

Type the following command into Tools > Library Package Manager > Package Manager Console:

Install-Package Microsoft.AspNet.WebApi.Client -Version 4.0.20710

Could not load file or assembly 'System.Net.Http.Formatting' or one , For Visual Studio 2013 and above, step 2) should read: "Allow NuGet to download missing packages" and "Automatically check for missing packages during build <dependentAssembly> <assemblyIdentity name="System.Net.Http​" I solved by right clicking on the reference. System.Net.Http.Formatting. System.Net.Http.Formating.dll. Problem: Missing Reference message the type or namespace name ‘formatting’ does not exist in the namespace ‘system.net.http’ Solution:


Adding to what Luiz answered above.

System.Net.Http.Formatting is a library and is used for media type formatting. For example: http://msdn.microsoft.com/en-us/library/system.net.http.formatting.jsonmediatypeformatter(v=vs.118).aspx

When referencing it, when I tried, I was looking to add a reference in my project and was looking in the Assemblies/Framework folder in Reference Manager.

It is actually in the Assemblies/Extensions folder in Reference Manager

Can't find System.Net.Http.Formatting dll, After some reading/searching online I found that once there was a System.Net.​Http.Formatting package which now appears to be discontinued  Right click on project and click Add a reference option, then go to Extensions from Assemblies tab and choose System.Net.Http.Formatting. If it is no in here you have to manually add in prgramme files-> Microsoft ASP.NET


If you got an error trying to install System.Net.Http.Formatting -Version 4.0.20710, try this one:

Install-Package WebApiDoodle.Net.Http.Formatting -Pre

I just found on NuGet: https://www.nuget.org/packages/WebApiDoodle.Net.Http.Formatting/3.0.0-pre01

Error loading System.Net.Http.Formatting, FileLoadException: Could not load file or assembly 'System.Net. At this point I am not sure what I am missing. Before updating WebApi component, did you check the actual reference of System.Web.Http in your project? The solution which uses the assembly System.Net.Http.Formatting is a Class library which is used by the Sharepoint Web Part. Error: Could not load file or assembly 'System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.


Right click on project and click Add a reference option, then go to Extensions from Assemblies tab and choose System.Net.Http.Formatting. If it is no in here you have to manually add in prgramme files-> Microsoft ASP.NET

System.Net.Http.Formatting nuget package has been replaced by , I see that there is worked on a System.Net.Http.Formatting version for .Net Standard 2.0, but I can't seem to find the official nuget package for  The System.Net.Http.Formatting.dll file is missing from my PC C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies folder: Why is this happening and how do I get it into that folder? I have another PC with the same situation. However, most of my other colleagues' PC has the dll file there. Thanks.


One other simple option for resolving this is to right click on references, click 'Manage NuGet References', Browse for 'Microsoft.AspNet.WebApi.Client' and install it or perhaps reinstall it. Review the package information to learn more.

HttpClient: Error – Does not contain a definition for 'ReadAsAsync , Client package available on NuGet here. OR. Add a reference of System.Net.Http​.Formatting.dll in you project. Add Reference -> Assemblies ->  System.Net.Http.Formatting. version written inside webconfig was 5.0.3 but inside the bin folder the library System.Net.Http.Formatting dll version was 4.0.2. so I just replaced with the same given inside bin. just do this clean project and build


22670 – Build warnings after referencing Microsoft.Net.Http NuGet , Net.Http.Extensions.dll assembly wants System.Net.Http.dll v1.5.0.0: > $ monodis --assemblyref CurrentVersion.targets" file use $(​AutoUnifyAssemblyReferences)? The weird part is that this reference did work earlier in the day with no errors, Http.Primitives missing DLL build error. Http.​Formatting. I'm deploying to Azure Websites through Git and the build is complaining that it can't find System.Net.Http.Formatting, System.Web.Http and System.Web.Http.WebHost. When I look for these files on my own computer I see that they are part of .NET 4.5 (which Azure Websites supports).


Visual C# 2005 Recipes: A Problem-Solution Approach, assembly.Name = "MyRegEx"; // Create the compiled regular expression Regex. NET Framework” (http://msdn.microsoft.com/netframework/ containing partial or erroneous information and will substitute defaults for any missing values. the requirements specified in the format string, or ParseExact will throw a System. MediaTypeFormatter Class. 10/28/2015; 2 minutes to read; In this article Base class to handle serializing and deserializing strongly-typed objects using ObjectContent. Namespace: System.Net.Http.Formatting Assembly: System.Net.Http.Formatting (in System.Net.Http.Formatting.dll) Inheritance Hierarchy. System.Object


Visual Basic 2008 Recipes: A Problem-Solution Approach, Once you have a reference to the assembly in your project, you can easily create a reference to the compiled regular Create Dates and Times from Strings Problem You need to create a System. NET Framework” (http:// containing partial or erroneous information and will substitute defaults for any missing values. System.IO.FileLoadException: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)