Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Basic Project Template for Asp.net Web Api?

Tags:

I am wondering if there is a "basic" asp.net web api template. I only see one "web api" project and it brings out of bit of stuff in and not sure if all of it I need.

like image 527
chobo2 Avatar asked Jan 16 '13 00:01

chobo2


1 Answers

You can either:

1) Create a new MVC4 project > choose Web API template - but that, as you point out, brings in a lot of stuff, including Modernizer, jQuery, Knockout and so on

2) Create a new ASP.NET empty Web application and install Web API web host from Nuget:

PM> Install-Package Microsoft.AspNet.WebApi 

You then end up with a very clean, basic project, including only the necessary DLLs.

3) If you want to self host Web API (not do an ASP.NET MVC4 project), you can create a new console application and install Web API self host from Nuget:

PM> Install-Package Microsoft.AspNet.WebApi.SelfHost 

which is perfect for lightweight services, but obviously you don't host inside IIS anymore so there are additional release/deployment considerations. You can read more about self host here -> http://www.asp.net/web-api/overview/hosting-aspnet-web-api/self-host-a-web-api

like image 163
Filip W Avatar answered Sep 20 '22 02:09

Filip W