Last post Sep 17, 2012 11:54 AM by SiggiGG
Aug 25, 2012 05:10 AM|hintzen|LINK
this problem is exactly the same as this post
I have all the latest RTM bits, Started a new MVC 4 in .Net 4.5, added the WebAPI nuget package and now my code analysis fails with the same error as reported in the above link.
CA0058 Error Running Code Analysis CA0058 : The referenced assembly 'System.Net.Http, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be found. This assembly is required for analysis and was referenced
by: C:\Projects\InHouse\TimeRecorder\StopGap\TimeRec\bin\TimeRec.dll, C:\Projects\InHouse\TimeRecorder\StopGap\packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll.
[Errors and Warnings] - (Global)
From what I can find this seemed to happen with the RC versions becuase there was a conflict between the .NET 4.5 framework System.Net.Http and the WebApi's version of the System.Net.Http.
Anybody know of any resolution for this?
Aug 29, 2012 11:29 AM|Oppositional|LINK
I think I have a workaround for this issue, but hopefully Microsoft will release an updated NuGet package for ASP.NET Web API soon.
When you add the Web API package (Microsoft.AspNet.WebApi.Core), there will be a reference to the System.Web.Http assembly contained in the package. What really should happen when targeting .NET 4.5 is the MVC 4 assembly should be referenced instead.
I hope a .NET 4.5 targeted package will be made available soon.
Sep 17, 2012 11:54 AM|SiggiGG|LINK
I just ran into this problem, and removing and re-adding the reference fixed it.
I find it very silly that creating a MVC 4 project targetting .NET 4.5 does not correctly setup the references.