I created a new project based on the Web API template, but found that it include a lot of unnecessary files that I don't need such as the regular mvc routes, css, js, cshtml files. I wanted a pure asp.net Web API application, What can I delete from this project template?
1 Answer
This is pretty annoying - there is no "empty" template for WebAPI by default so you have to delete the following:
- /Areas/
- /Content/
- /Images/
- /Scripts/
- /Views/
- favicon.ico
This should leave you with the default generated Controllers and App_Start folders which, along with the Global.asax & Web.Config is the only thing you really need for a plain WebAPI project.
I haven't tried this, but it claims to provide a real empty WebAPI template: http://visualstudiogallery.msdn.microsoft.com/a989a149-4bc3-4292-ac8a-5101ee1722d7
4 Comments
clifford.duke
Is it alright to remove bundleconfig and routeconfig as well?
CodingIntrigue
Yes, you could remove those too. BundleConfig is only used for minifying JS/CSS and RouteConfig is for MVC routes, not the WebAPI ones which are stored in WebApiConfig
clifford.duke
Thanks for that, it's so annoying that it comes cluttered regardless of your needs haha
Mike Wasson
In VS2013, you can select "Empty" template and then check "include Web API" to get a minimal Web API project.