Saturday, January 25, 2014

WebAPI (REST Service) - How To Run in VS2010 ?

To Run WebAPI using VS2010 (i.e framework 4.0)

Open your project first. then

Go to package Manager Console in VS (under tools) [NuGet] -> type following version

Install-Package Microsoft.AspNet.WebApi -Version 4.0.30506

The reason is, the latest WebApi is compatible only to .net 4.5. so if you try to install without specifying exact version number, it will bring latest and try to install in your project and will finally complaint that the version is not compatible.

The good thing is, along with WebAPI abstraction classes (system.web.http) it will also install Newton.Soft.JSON class too, which is a must in REST service to reduce payload. Roughly if you use JSON rather XML your payload size will come down to about average 60% lower.

I am very much impressed with this video, which explains very basics of WebAPI- Thanks Shiv Kumar.

ASP.NET Web API and RESTful Services - Part 1 






1 comment: