1
votes

I made sure that my solution and the 10 projects are all compiled to .NET 4.5.1 but still I get this warning:

Consider app.config remapping of assembly "System.Net.Http.Formatting, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "4.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Net.Http.Formatting.dll] to Version "5.0.0.0" [C:\TLP\packages\Microsoft.AspNet.WebApi.Client.5.0.0\lib\net45\System.Net.Http.Formatting.dll] to solve conflict and get rid of warning.

Consider app.config remapping of assembly "System.Web.Http, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "4.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Http.dll] to Version "5.0.0.0" [C:\TLP\packages\Microsoft.AspNet.WebApi.Core.5.0.0\lib\net45\System.Web.Http.dll] to solve conflict and get rid of warning.

My projects are not referencing anywhere the .NET 4.0 MVC assemblies System.Net.Http.Formatting and System.Web.Http.

In my Web API project I reference the assemblies in the nuget package folder not the assemblies in the C:\Program Files\Microsoft ASP.NET\ASP.NET MVC4\Assemblies\

How can I fix that?

1
At least one of the projects is referencing a newer version of these assemblies. "C:\TLP" ought to ring a bell.Hans Passant
@HansPassant I do not hear the bell ringing. There is only one project referencing web stuff.Elisabeth
Windows machines don't have a C:\TLP directory, you put it there. Just rename that directory and rebuild your solution. You'll find the project that uses it.Hans Passant
@HansPassant Look... I create an empty Web API project. Then I add the nuget package Web API 2 with all its dependencies and then the mess starts... When I compile I get the conflict warning etc... so it can not be my fault. And why am I not allowed to create a project on C:\ ??Elisabeth
@HansPassant When I create a Web API (not empty and then add the nuget web api packages) which is complete with all packages then I do not have any problem...Elisabeth

1 Answers

0
votes

Finally I also found the solution :p

Its before the pc...

When you search in VS in the Nuget Packet Manager (not console) for "autofac web api" you get the autofac for web api 1.0 integration. When you continue to page 3 of the search results you find the autofac web api 2 integration. Thats not fair... but I am not alone :p see the

comments: MVC5, WebAPI2 and AutoFac not working. All Nuget packages updated