Chapter 12: Customizing the Development Environment | 343 |
Creating New Project Templates
If you’re working on a single project that lasts a long time, you might be satisfied with using a default template and doing a
the default template that you don’t ever use, or changing an existing item for version upgrades. In addition to customizing existing templates, you might want to create a brand new template for a new project type that doesn’t yet exist.
The example in this section will show you how to customize the ASP.NET MVC project template. The specific changes made to the template will be to remove much of the default code provided by the template. The assumption is that once you’ve written a few ASP.NET MVC applications, you won’t need the default files as examples and would prefer to start with a more
Modifying a Project
The easiest way to get started with creating a new project template is to start a new project that is most similar to the project type you want to create. If you wanted a blank project, you might start with a Console project because there aren’t many items and it’s quicker to delete them all. In the scenario for this section, we want to create a specialized ASP.NET MVC project, so it makes sense to create a new ASP.NET MVC project. The following steps show you how:
1.Press
2.Open the Controllers folder and delete its contents.
3.Open the Models folder and delete its contents.
4.Open the Views folder but only delete the Account and Home folders.
5.Open the Shared folder, under the Views folder, and delete its contents.
6.