I have a solution with 3 projects:
Solution.Web.Core - Common classes
Solution.Web.Mvc - MVC 4
Solution.Web.Api - Web Api 2 aka running ASP.NET 5.0 (beta-1) assemblies
I have the WebApi set up as a child application (in IIS) of the MVC application, however, I'm having trouble achieving full isolation of this project.
Because Solution.Web.Core
has some references to ASP.NET 4.0 assemblies, if I add a reference to this project in Solution.Web.Api
I get the following exception at runtime:
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)
How can I prevent this error occurring in Solution.Web.Api
so that I can reference Solution.Web.Core
despite it referencing older assembly versions of ASP.NET?
Note: Since the error says "System.Net.Http.Formatting
or one of its dependencies" I'm honestly not even sure how to find out which is the exact offending assembly(s).