Ravi
Ravi

Reputation: 853

Getting exception System.Web.Http in VS2013 using breeze?

I am trying to create the HotTowel Sample application from Jhon Papa using Breeze and AngularJS. I have installed all the required packages and before installing Breeze.WebApi package everything works fine but after i installed this package then i am getting this below exception on WebApiRoute configuration method.

<ExceptionMessage>
Could not load file or assembly 'System.Web.Http, Version=4.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)

I have referenced the System.Web.Http dll to project but with latest 5.0.0 version.

Upvotes: 1

Views: 1026

Answers (2)

Jay Traband
Jay Traband

Reputation: 17052

This was likely a result of trying to use the new Microsoft WebApi2 nuget packages in VS 2013. Previously Breeze did not support these.

As of now, Breeze 1.4.5 has support for Microsoft's ASP.NET WebApi 2 and Entity Framework 6. Please see http://www.breezejs.com/documentation/download.

Upvotes: 0

Chandermani
Chandermani

Reputation: 42669

You can try to do a binding redirect to point to new assemblies and see if it works.

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
      </dependentAssembly>
  </assemblyBinding>
</runtime>

Upvotes: 1

Related Questions