aamir sajjad
aamir sajjad

Reputation: 3039

Could not load type 'System.Net.Http.HttpClientExtensions' from assembly 'System.Net.Http.Formatting

How can get rid of this problem? I have asp.net MVC 4.0 beta installed on my machine, as I have read in some forum that it is creating conflict, and if you uninstall it should work fine. However, my concern is that do I have to reinstall the MVC 4.0 beta to make the web application work built using MVC 4.0 beta. don't know really.

your answer will be appreciated.

Could not load type 'System.Net.Http.HttpClientExtensions' from assembly 'System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

class Program
{
    static void Main(string[] args)
    {

        using (var httpClient = new HttpClient())
        {
            try
            {
                var responseStartSchecdule = httpClient.PostAsJsonAsync(
                "http://dev02.xav.com/api/Track/StartScheduleRumble",
                CancellationToken.None
            ).IsCompleted;
                
                var responseFinishSchecdule = httpClient.PostAsJsonAsync(
                "http://dev02.xav.com/api/Track/FinishRumble",
                CancellationToken.None
            ).IsCompleted;
                
            }
            catch (Exception)
            {
                // add tracing implementation here to trace if there is some error      
            }
        }

    }

Upvotes: 0

Views: 2815

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039438

There have been a couple of breaking changes between the Beta and the RC. Having both installed at the same time is not recommended. So I would recommend you uninstalling the beta, installing the RC and then recompiling your application against the RC. Or if for some reason you want to stick with the Beta you will have to ensure that you haven't downloaded some assembly (or installed via NuGet) that depends on the RC.

Upvotes: 2

Related Questions