基本项目模板Asp.net的Web API?
我想知道是否有一个基本的asp.net网页API模板。我只看到一网页API项目,它带出的东西,有点不知道这一切我所需要的。
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.
您可以:
1)创建一个新的 MVC4项目>选择网页API模板的 - 但是,正如你所指出的,带来了很多东西,包括现代化主义者,jQuery的,淘汰赛等。
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)创建一个新的 ASP.NET空Web应用程序的并安装的NuGet网页API的虚拟主机:
2) Create a new ASP.NET empty Web application and install Web API web host from Nuget:
PM> Install-Package Microsoft.AspNet.WebApi
您然后结束了一个非常干净的,基本的项目,仅包括必要的DLL。
You then end up with a very clean, basic project, including only the necessary DLLs.
3)如果你想自我承载Web API(而不是做一个ASP.NET MVC4项目),你可以创建一个的新控制台应用程序的和的NuGet安装的Web API自我主持人:
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
这是完美的轻量级服务,但显然你没有IIS内举办了,所以有更多的版本/部署注意事项。你可以阅读更多关于自我的主机在这里 - > http://www.asp.net/web-api/overview/hosting-aspnet-web-api/self-host-a-web-api