
346Microsoft Visual Studio 2010: A Beginner’s Guide
You can share the project template with other developers too. The next section shows what to do to get the project template to appear in VS.
Using the New Project Template
The instructions for exporting the project template in the preceding section chose “Automatically import the template into Visual Studio.” The use of the word “import” might make you think there is some magic process going on in the background, which there is to some extent. However, all the Export Template Wizard did was copy the Custom ASP.NET MVC Web Application.zip file from the Output location to <My Documents>\Visual Studio 2010\Templates\ProjectTemplates, which I’ll call local project templates. The <My Documents> folder location can differ, depending on the version of Windows you’re running. Once the file appears in the local project templates folder, you can verify that it’s been imported into VS by pressing
If you had not checked “Automatically import the template into Visual Studio” (Figure
.zip file to the local project templates folder yourself and the project template would appear in VS. If you share the Custom ASP.NET MVC Web Application.zip file with another developer, she can copy to the local project templates folder also.
If you delete the file from the local project templates folder, it will no longer appear in the VS New Projects window.
Another option for adding project templates is to copy the project templates file to a folder under \Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates, which I’ll call global project templates. There are various folders under global project templates, including CSharp VisualBasic, Web, and more; each folder corresponding to folders in the VS New Project window. Under each folder is a locale
Unlike templates in the local project templates folder, where all you need to do is copy the file, project templates in the global project templates folder don’t automatically show up. To test the global project templates scenario, you should remove the project template from your local project templates folder. You must close down VS and execute the following in a command window, which you should open by selecting Start All Programs Microsoft Visual Studio 2010 Visual Studio Tools