I have a solution with three projects:
Solution.Web.Core - General Classes
Solution.Web.Mvc - MVC 4
Solution.Web.Api - Api 2 web application that supports ASP.NET 5.0 (beta-1) builds
I have WebApi configured as a child application (in IIS) of an MVC application, however I am having problems completely isolating this project.
Since Solution.Web.Core has some links to ASP.NET 4.0 assemblies, if I add a link to this project in Solution.Web.Api , at runtime I get the following exception:
Failed to 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 manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
How can I prevent this error from occurring in Solution.Web.Api so that I can reference Solution.Web.Core despite referring to older versions of ASP.NET?
Note. Since the error says " System.Net.Http.Formatting or one of its dependencies," I honestly donβt even know how to find out which particular offensive assembly (s) are.
source share