I am using Asp.Net MVC 4.0 Project Template then what is the web api version i will be using in my projects. I don't know how to find the web api version using in my project. How to get this version of web api?
-
1Check the NuGet package version from packages.config.– Ufuk HacıoğullarıMay 19, 2015 at 19:41
-
He's asking which version of Web API he should use with MVC 4. I guess the answer is "whichever you want".– user47589May 19, 2015 at 20:17
-
1A closely related post here.– RBTNov 24, 2017 at 11:36
1 Answer
By default a MVC 4.0 template ships with version 4.0.20710.0 of WebAPI (aka Web api 1). To check this, open your solution, exapnd the webapi solution, then open the packages.config file that holds the nuget config for what you have installed. If you have not updated the packages you should see this.
<package id="Microsoft.AspNet.WebApi" version="4.0.20710.0" targetFramework="net40" />
You can now go to the nuget website and examine the package history here. I have copied the contents of this page below. As you can see this version of web api was release on 11th Aug 2012. This version was better known as "web api 1" after Web API 2 was release around Jan 2014. You can upgrade you MVC4 project to use Web API 2 if you wish by using the nuget update wizard.
Version History Version Downloads Last updated Microsoft ASP.NET Web API 2.2 5.2.3 (this version) 249542 Monday, February 09 2015
Microsoft ASP.NET Web API 2.2 5.2.3-beta1 11688 Wednesday, December 17 2014
Microsoft ASP.NET Web API 2.2 5.2.2 545094 Thursday, August 28 2014
Microsoft ASP.NET Web API 2.2.2 5.2.2-rc 10649 Saturday, August 23 2014
Microsoft ASP.NET Web API 2.2 5.2.0 351005 Tuesday, July 01 2014
Microsoft ASP.NET Web API 2.2 5.2.0-rc 18499 Tuesday, May 27 2014
Microsoft ASP.NET Web API 2.1 5.1.2 416403 Wednesday, April 02 2014
Microsoft ASP.NET Web API 2.1 5.1.1 307194 Monday, February 10 2014
Microsoft ASP.NET Web API 2.1 5.1.0 201058 Friday, January 17 2014
Microsoft ASP.NET Web API 5.1.0-rc1 19761 Friday, December 06 2013
Microsoft ASP.NET Web API 2 5.0.1 152379 Thursday, February 13 2014
Microsoft ASP.NET Web API 2 5.0.0 752667 Thursday, October 17 2013
Microsoft ASP.NET Web API 5.0.0-rc1 28262 Friday, August 23 2013
Microsoft ASP.NET Web API 5.0.0-beta2 24088 Wednesday, June 26 2013
Microsoft ASP.NET Web API 5.0.0-beta1 14905 Wednesday, June 26 2013
Microsoft ASP.NET Web API 4.0.30506 648619 Thursday, May 30 2013
Microsoft ASP.NET Web API 4.0.20710 1246927 Saturday, August 11 2012
Microsoft ASP.NET Web API (RC) 4.0.20505 112922 Thursday, May 31 2012
-
1I have checked and it is like this Microsoft.AspNet.WebAPI 5.2.2. So this is Web API 2.2? May 20, 2015 at 16:48
-
For whoever wants to check on release notes of each version, it's available on their repo on GitHub: github.com/aspnet/AspNetWebStack/releases– MMalkeFeb 8, 2020 at 13:57