问题
What's the cleanest way to remove all extras that normally come with Visual Studio API Template, things like Views and other stuff that are not needed if you just want to have a WebAPI service??
I'm assuming that the folder VIEWS is for MVC Views ...maybe I'm wrong and it's all needed to have a running APIs.
回答1:
- Launch Visual Studio
- go to
File
->New Project
->ASP.NET MVC 4 Web Application
. - Click OK
- then select "Empty" instead of "Web API"
That will not have any extras such as Views.
回答2:
- Launch Visual Studio
- Go To File -> New Project -> Web -> ASP.NET Web Application
- Enter name and press Ok
- Select Empty from Templates and then Select Web API from "Add folders and core references for: " section
- Press Ok
- You will get an empty web api project with all necessary dlls and web appi configuration added in the project.
- You will have to add your first controller by yourself though.
来源:https://stackoverflow.com/questions/19150879/cleanest-way-to-start-a-webapi-project-in-visual-studio-no-views