Microsoft 9GD00001 Computer Accessories User Manual


 
346 Microsoft 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
CTRL-SHIFT-N and
observing that Custom ASP.NET MVC Web Application appears in the list.
If you had not checked “Automatically import the template into Visual Studio”
(Figure 12-2), then you could have copied the Custom ASP.NET MVC Web Application
.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 code—for instance,
English is 1033—and you would copy the file into the locale folder for the category you
wanted the project template to appear in. For example, if you wanted the project template to
appear in Visual C# | Web in the New Projects window, copy the project template *.zip file to
\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates\CSharp\Web.
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 | right-click on Visual Studio Command