Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
362 views
in Technique[技术] by (71.8m points)

c# - Where can I find a NuGet package for upgrading to System.Web.Http v5.0.0.0?

Just upgraded an ASP.NET MVC4 project to use Unity.WebApi version 5.0.0.0 and it requires System.Web.Http v 5.0.0.0 as per the following error:

Assembly 'Unity.WebApi, Version=5.1.0.0, Culture=neutral, PublicKeyToken=43da31bc42a85347' uses 'System.Web.Http, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'   

I am currently referencing System.Web.Http v4.0 but have the following NuGet packages upgraded to their respective latest versions:

  • ANTLRv3

  • Microsoft ASP.NET Universal Providers

  • Microsoft.Web.Infrastructure

  • Microsoft ASP.NET MVC

  • Microsoft ASP.NET Razor

  • Microsoft ASP.NET Universal Providers Core Libraries

  • Microsoft ASP.NET Universal Providers

  • Microsoft ASP.NET Web API 2 Client

  • Microsoft ASP.NET Web API 2 Core

  • Microsoft ASP.NET Web API 2 Web Host

  • Microsoft ASP.NET Web API 2

  • Microsoft ASP.NET Web Page

  • Microsoft.Web.Infrastructure

  • WebGrease

    via NuGet. I have not listed relevant JavaScript libraries such as Micrososft.jQuery.Unobtrusive Validation, etc.

What is the NuGet package to upgrade System.Web.Http or do I have to do this manually?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You need the Microsoft.AspNet.WebApi.Core package.

You can see it in the .csproj file:

<Reference Include="System.Web.Http, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..packagesMicrosoft.AspNet.WebApi.Core.5.0.0lib
et45System.Web.Http.dll</HintPath>
</Reference>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...