Skip to Content
Visual Studio Hacks
book

Visual Studio Hacks

by James Avery
March 2005
Intermediate to advanced
304 pages
19h 23m
English
O'Reilly Media, Inc.
Content preview from Visual Studio Hacks
Build a Custom Tool #47
Chapter 6, Speed Hacks
|
185
HACK
After choosing what language type to add your custom tool to, the next step
is to create a new key under that value. This key should be named the same
as your custom tool and will need to include three values; these values are
shown in Table 6-3.
Figure 6-4 shows the registry keys and values for this example custom tool.
Running the Tool
Now your custom tool should be ready to use. Inside Visual Studio, you can
create a file and specify that it should be handled by your custom tool in the
Properties window, as shown in Figure 6-5.
Whenever this file is saved, the custom tool will be run and your code will
be generated. You can view this generated code by clicking the Show All
Files button in the Solution Explorer. You will then see a plus sign next to
your file, and when you click that plus sign, you will see the generated file as
shown in Figure 6-6.
Table 6-2. Language GUIDs
GUID Language
{164B10B9-B200-11D0-8C61-00A0C91E29D5} VB.NET
{E6FDF8B0-F3D1-11D4-8576-0002A516ECE8} J#
{FAE04EC1-301F-11d3-BF4B-00C04F79EFBC} C#
Table 6-3. Custom tool key values
Name Type Description
(Default) REG_SZ (String) A description of your custom tool
CLSID REG_SZ (String) The GUID for your custom tool (as
defined in the
Guid attribute)
GeneratesDesignTimeSource REG_DWORD (DWORD) Specifies whether your custom
tool creates a new file: 1 = True,
0 = False
Figure 6-4. Custom ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Mastering Visual Studio .NET

Mastering Visual Studio .NET

Chris Sells, Ian Griffiths, Jon Flanders
C# 4.0 Unleashed

C# 4.0 Unleashed

Bart De Smet
Programming in the .NET Environment

Programming in the .NET Environment

Damien Watkins, Mark Hammond, Brad Abrams

Publisher Resources

ISBN: 0596008473Errata Page