Skip to Main Content
Visual Studio Hacks
book

Visual Studio Hacks

by James Avery
March 2005
Intermediate to advanced content levelIntermediate to advanced
304 pages
19h 23m
English
O'Reilly Media, Inc.
Content preview from Visual Studio Hacks
392
|
Chapter 12, Extending Visual Studio
#88 Create a File Template
HACK
Similar to the .aspx extension for the Web Form templates, ASP.NET HTTP
Handlers use an .ashx extension. We won’t go into all the differences
between a Web Form and an HTTP Handler in this hack. The salient differ-
ence to note is that the initial text that the HTTP Handler template uses will
be different from the Web Form template. Whereas the .aspx file contains
markup text with angle brackets, the HTTP Handler template is actually all
code; in this case, it’s C# or Visual Basic .NET.
Get Your Template Listed in the Add New Item Dialog
Navigate to the C:\Program Files\Microsoft Visual Studio .NET 2003 folder.
Depending on what language (for example, C# or VB), look for either the
VC# or VB7 folder. Inside the given language folder, look for CSharp-
ProjectItems or VBProjectItems, respectively. Compare the filenames in the
folders to the templates in the Add New Item dialog. This is where Visual
Studio stores templates. It uses a combination of .vsz files and .vsdir files. So
to get our template display, we’ve got to create the appropriate .vsz and .
vsdir files. The entry in the .vsdir file will point to our .vsz file.
VSZ Files. Visual Studio .NET uses .vsz files to launch wizards. These are
simple text files that look like the .ini files of old, but with only one section.
To create a new VSZ file, you can copy one of the
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft Visual Studio 2015 Unleashed, Third Edition

Microsoft Visual Studio 2015 Unleashed, Third Edition

Mike Snell, Lars Powers
.Net Framework Essentials

.Net Framework Essentials

Thuan L. Thai, Hoang Lam
C# 5.0 Unleashed

C# 5.0 Unleashed

Bart De Smet
Programming .NET Security

Programming .NET Security

Adam Freeman, Allen Jones

Publisher Resources

ISBN: 0596008473Errata Page