Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

WebAPI + EPi + .NET 4.5 not working

Vote:
 

Hi, everyone,

I've followed the example here:

http://www.frederikvig.com/2012/02/using-the-asp-net-web-api-framework-with-episerver/

 

However, I've stumbled upon the first step: registering a route. This is the error I get on:

 System.Net.Http.HttpMessageHandler' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

in

routes.MapHttpRoute(
                       name: "ActionApi",
                       routeTemplate: "api/{controller}/{action}/{id}",
                       defaults: new { id = RouteParameter.Optional }
                    );

    

Anyone had the same problem? And a solution?

 

 

#73113
Jul 05, 2013 17:14
Vote:
 

The problem might be that System.Net.Http is already included in 4.5. The reference in your project probably points to the one in the webapi package, which is needed for 4.0? If so, just remove that reference and add one to the one included in the framework. Hopefully that will solve your problem.

#73122
Jul 07, 2013 9:27
Vote:
 

Version 2.0.0.0 is also an old version, afaik you should use version 4.0.0.0.

Frederik

#73124
Jul 08, 2013 8:43
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.