One of the biggest advantages of using a programmer's editor is syntax highlighting. However, because Visual Studio 6 was released a couple of years before C# and was designed to develop Visual C++ applications, you'll need to do a little tweaking for Visual Studio 6 to highlight C# code correctly. The first step is to change a Visual Studio Registry key. Locate the following key in your Registry by using Regedit.exe or another Registry editor: -
HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\ Text Editor\Tabs/Language Settings\C/C++\FileExtensions
The value will contain a string like the following: -
Add the .cs extension at the end of the value. (Note that an ending semicolon is optional.) The new Registry value would look like this: -
Now, when you open a file in Visual Studio 6 with a .cs extension, Visual Studio will recognize it as a supported file.
Next you need to tell Visual Studio which files are keywords in C#. To do this, you create and place in the same folder as the msdev.exe file a file named usertype.dat. This is an ASCII text file that contains all the keywords that should be highlighted-place one keyword on each line. When Visual Studio starts up, it will load this file. Therefore, when you make a change to this file, you must restart Visual Studio to see your changes. Figure 3-1 shows what your C# code will look like once you've followed these steps.
Figure 3-1 One advantage of using an editor that provides syntax highlighting like the one in Visual Studio 6 is immediate feedback as to whether a keyword is valid.-
Obviously, if you want the maximum in productivity in the .NET environment, you should use Visual Studio.NET. Not only does it provide all the integrated tools and wizards for creating C# applications, but it also includes productivity features such as IntelliSense and Dynamic Help. With IntelliSense, as you type in a namespace or class name, members are automatically displayed so that you don't have to remember every member of every class. IntelliSense also displays all arguments and their types when you type in the name of a method and an opening parenthesis. Visual Studio 6 also provides this capability, but obviously it doesn't support the .NET types and classes. Dynamic Help is a feature new to Visual Studio. While you're typing code into the editor, a separate window displays topics related to the word the cursor is in. For example, if you type the keyword namespace, the window shows hyperlinks to help topics covering the usage of the namespace keyword.