3

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 1

3

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

Sign up to request clarification or add additional context in comments.

4 Comments

Is it alright to remove bundleconfig and routeconfig as well?
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
Thanks for that, it's so annoying that it comes cluttered regardless of your needs haha
In VS2013, you can select "Empty" template and then check "include Web API" to get a minimal Web API project.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.