Customizing Visual Studio .NET

 < Day Day Up > 



I’m always surprised at the number of developers I find who are using VS .NET with everything set exactly as it came out of the box. There are hundreds of settings that you can tweak and adjust in VS .NET, and it’s the rare developer who won’t benefit from at least some customization. In this section, I’ll show you some of the places where you might benefit from making your own changes to the IDE. I assume that you already know the basics: customizing toolbars via Tools Customize; rearranging, docking, and floating windows with the mouse; and opening new windows from the View menu. Instead, I’ll concentrate on some of the more obscure things you can change.

Using Profiles

A good place to start is with the My Profile tab on the Start Page. If you’ve closed the Start Page, you can get it back by selecting Help Start Page (why this isn’t on the View menu with all of the other windows remains one of the mysteries of VS .NET). You probably saw this page (shown in Figure 6.1) when you first installed VS .NET, but it’s worth another visit now that you have some experience with the product.

click to expand
Figure 6.1: Selecting a profile

The controls on the My Profile tab interact in ways that aren’t immediately obvious. Choosing a setting from the Profile combo box is equivalent to choosing a particular group of settings in the Keyboard Scheme, Window Layout, and Help Filter combo boxes. If you then make any change in one of those other boxes (even one that matches an existing profile), the profile changes to “(custom)”.

Warning

Changes to your profile take effect immediately, and there’s no undo for them, so experiment with caution. If you’ve developed a custom window layout that you like, you may not want to make any changes to your profile.

The Keyboard Scheme combo box lets you set the keyboard shortcuts to be compatible with previous IDEs:

  • Visual Studio .NET Defaults

  • Visual Basic 6

  • Visual C++ 2

  • Visual C++ 6

  • Visual Studio 6

The Window Layout combo box lets you choose among several standard ways to arrange the various tool windows:

  • Visual Studio Default

  • Visual Basic 6

  • Visual C++ 6

  • Student Window Layout

  • No Tool Windows Layout

The Help Filter combo box lets you select a default subset of the help feature to search when you click F1. You can also choose whether to display help in a window within VS .NET (Internal Help) or in its own window (External Help). Finally, you can decide what to display when you launch VS .NET.

Although it’s tempting to select a profile that corresponds to whatever tool you were using before VS .NET so as to get an immediate productivity gain, I personally prefer to use the default Visual Studio Developer profile. That’s because many books and articles assume that you’re using the default profile. If you’re not using that profile, you may have trouble following specific instructions. As a simple example, if you’re a Visual Basic (VB) 6 developer making the transition and you use the VB 6 keyboard shortcuts, your IDE will use F8 to debug the next statement. This can be confusing when you’re reading a tutorial, book, or article that instructs you to click F11 to debug, because that’s the default keystroke.

I also prefer to leave the Help Filter set to “(no filter)”. That’s because the indexing in the VS .NET help (and MSDN help in general) is not all that reliable, and I’ve found that setting the filter can keep me from finding help topics that seem perfectly applicable to my current search. You should experiment with the filter settings to see whether you prefer the focused search in the topics that VS .NET thinks apply, or the wider search that covers everything. The trade-off is between possibly missing something pertinent and having to wade through lots of irrelevant information.

Note

The Start Page itself can be customized too, though many developers won’t need to bother with this. Still, in a corporate setting you can use a custom Start Page to deliver content to all of your developers, just as Microsoft delivers updates to the Online Resources tab. See “Customizing the Visual Studio .NET 2003 Start Page” (http://msdn.microsoft.com/library/en-us/dv_vstechart/html/vstchCustomizingVisualStudioStartPageEverett.asp) for details.

Setting VS .NET Options

The Tools Options menu item is your gateway to hundreds of ways to customize VS .NET. It’s impossible to be specific about how many customizations you’ll find here, because this is a part of the extensible interface; third-party products can add their own property pages to the Options dialog box. Figure 6.2 shows this dialog box on my computer; as you can see, several products (such as Logidex and NUnitAddin) have added themselves to the list of folders at the left side of the dialog box.

click to expand
Figure 6.2: The Options dialog box

Here are some of the specific settings that I’ve found it helpful to change:

  • Environment, General Under this menu, increase the number of items in the most recently used lists from 4 to a more reasonable number, such as 10 or 15. Unless you have a very small screen or don’t work with many projects, you’ll find this the easiest way to locate your current work.

  • Environment, Documents Under this menu, check the Auto-load Changes box. This will remove one of the annoying “Are you sure?” prompts that litter software today. This is especially useful if you’re using an external source code control utility. Otherwise, you’ll be prompted every time you get a more recent copy of a file that you have open.

  • Environment, Fonts And Colors The default font for VS .NET is a 10-point Courier font. Depending on your monitor size and resolution (and your eyesight), you might find it useful to select a smaller font here. Also, in Courier New it can be hard to tell the difference between some characters (such as the numeral 1 and the lowercase l, or curly braces and square brackets), a problem that can be alleviated with specialized programming fonts. Figure 6.3 shows the same window using 10-point Courier and 8-point ProFont; as you can see, the ProFont version gets considerably more information into the same space. This is useful when you’re trying to get a sense of the overall code flow, or you’re reading extensive comments (as long as you don’t reduce the font to the point of eyestrain). Of course, fonts are a matter of personal preference; if you like your source code in 24-point Garamond Bold, then by all means set that as your default font.

    click to expand
    Figure 6.3: Comparing 10-point Courier with 8-point ProFont

    Tip

    You can download ProFont and Sheldon (another excellent programmer’s font) from www.tobias-jung.de/seekingprofont/.

  • Database Tools, Server Explorer The default login timeout is 15 seconds. If you’re working with a SQL Server across a wide area network (WAN) or the Internet, that will probably be too short. Increasing this value to 60 seconds can help avoid maddening connectivity problems.

Whether or not you agree with these recommendations, take a few minutes to explore all the choices in the Options dialog box. You’ll probably find some control over the environment that you didn’t know you had.

Note

In addition to the general settings I’ve discussed that affect all of your development with VS .NET, each individual language has its own settings (under “Text Editor” in the options tree). You can, for example, control whether each language has line numbering displayed in the editor window, or how many spaces a tab is equivalent to.

Using VS .NET PowerToys

For even more customization possibilities, check out the VS .NET PowerToys. These are a set of utilities designed to work with VS .NET that are not part of the product, even though they have input and code from the product team. The PowerToys home page is at www.gotdotnet.com/team/ide/. The lineup continues to expand, but here are some of the PowerToys that I find useful:

  • VSTweak Just in case the Options dialog box doesn’t offer enough settings for you, VSTweak adds control over more settings. The utility includes a manager for command window aliases, editing for most recently used (MRU) lists, and the ability to extend the list of file extensions that VS .NET recognizes.

  • VSWindowManager You’ve probably noticed that the IDE opens a different set of default windows when you enter debug mode. That’s an example of a window layout. VSWindowManager lets you define custom window layouts and apply them automatically or on demand. If there’s a set of tools that you always want to see when editing Extensible Markup Language (XML) files, for example, you can create a window layout of those tools and then recall it with a single menu choice.

  • VSMouseBindings This utility lets you assign commands to the buttons on your mouse, even if you have a five-button mouse.

  • VSEdit By default, if you double-click a C# file (or any other file associated with VS .NET) in Windows Explorer, it will open in a whole new VS .NET session. If you use VSEdit, you can open the file in an existing session instead, which is much faster.



 < Day Day Up > 



Coder to Developer. Tools and Strategies for Delivering Your Software
Coder to Developer: Tools and Strategies for Delivering Your Software
ISBN: 078214327X
EAN: 2147483647
Year: 2003
Pages: 118

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net