[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?

This question is related to c# .net asp.net-mvc-4 nuget asp.net-web-api2

The answer is


I have several projects in a solution. For some of the projects, I previously added the references manually. When I used NuGet to update the WebAPI package, those references were not updated automatically.

I found out that I can either manually update those reference so they point to the v5 DLL inside the Packages folder of my solution or do the following.

  1. Go to the "Manage NuGet Packages"
  2. Select the Installed Package "Microsoft ASP.NET Web API 2.1"
  3. Click Manage and check the projects that I manually added before.

Examples related to c#

How can I convert this one line of ActionScript to C#? Microsoft Advertising SDK doesn't deliverer ads How to use a global array in C#? How to correctly write async method? C# - insert values from file into two arrays Uploading into folder in FTP? Are these methods thread safe? dotnet ef not found in .NET Core 3 HTTP Error 500.30 - ANCM In-Process Start Failure Best way to "push" into C# array

Examples related to .net

You must add a reference to assembly 'netstandard, Version=2.0.0.0 How to use Bootstrap 4 in ASP.NET Core No authenticationScheme was specified, and there was no DefaultChallengeScheme found with default authentification and custom authorization .net Core 2.0 - Package was restored using .NetFramework 4.6.1 instead of target framework .netCore 2.0. The package may not be fully compatible Update .NET web service to use TLS 1.2 EF Core add-migration Build Failed What is the difference between .NET Core and .NET Standard Class Library project types? Visual Studio 2017 - Could not load file or assembly 'System.Runtime, Version=4.1.0.0' or one of its dependencies Nuget connection attempt failed "Unable to load the service index for source" Token based authentication in Web API without any user interface

Examples related to asp.net-mvc-4

Better solution without exluding fields from Binding How to remove error about glyphicons-halflings-regular.woff2 not found When should I use Async Controllers in ASP.NET MVC? How to call controller from the button click in asp.net MVC 4 How to get DropDownList SelectedValue in Controller in MVC Return HTML from ASP.NET Web API There is no ViewData item of type 'IEnumerable<SelectListItem>' that has the key country Return JsonResult from web api without its properties how to set radio button checked in edit mode in MVC razor view How to call MVC Action using Jquery AJAX and then submit form in MVC?

Examples related to nuget

How do I install the Nuget provider for PowerShell on a unconnected machine so I can install a nuget package from the PS command line? How to use Bootstrap 4 in ASP.NET Core Assets file project.assets.json not found. Run a NuGet package restore .net Core 2.0 - Package was restored using .NetFramework 4.6.1 instead of target framework .netCore 2.0. The package may not be fully compatible Nuget connection attempt failed "Unable to load the service index for source" Getting "project" nuget configuration is invalid error Build error, This project references NuGet Unable to Install Any Package in Visual Studio 2015 NuGet Packages are missing How can I clear the NuGet package cache using the command line?

Examples related to asp.net-web-api2

CORS: credentials mode is 'include' FromBody string parameter is giving null Web API optional parameters HTTP 415 unsupported media type error when calling Web API 2 endpoint Asp.Net WebApi2 Enable CORS not working with AspNet.WebApi.Cors 5.2.3 How to implement oauth2 server in ASP.NET MVC 5 and WEB API 2 Pass multiple complex objects to a post/put Web API method Where can I find a NuGet package for upgrading to System.Web.Http v5.0.0.0? How to get base URL in Web API controller? No connection could be made because the target machine actively refused it?