User ID:
Password:
Remember Me:
Forgot Password?
Not a member?
Click here for more information and to register.

    Visual Studio Syntax Highlighting for C# Files



    Environment: Visual Studio and C#

    Here are the instructions necessary to have Visual Studio syntax-highlight your C# files.

    1. Locate the following key in your registry (using regedit or any other registry editor):

      HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Text Editor\Tabs/Language Settings\C/C++\FileExtensions

      This value will contain a value like the following:

      cpp;cxx;c;h;hxx;hpp;inl;tlh;tli;rc;rc2

      Simply add the .cs extension to the end as in this example:

      cpp;cxx;c;h;hxx;hpp;inl;tlh;tli;rc;rc2;cs

    2. Download the usertype.dat file (at the bottom of this document) and copy it to the same directory as msdev.exe (Visual Studio editor) (By default this will be c:\program files\microsoft visual studio\common\msdev98\bin). This file contains all the C# keywords

    Downloads

    Download (zipped) usertype.dat file (containing C# keywords) - 1 Kb

    About the Author

    I am a Program Manager and Content Strategist for the Microsoft MSDN Online team managing the Windows Vista and Visual C++ developer centers. Before being employed at Microsoft, I was awarded MVP status for the Visual C++ product. A 20+ year veteran of programming with various languages - C++, C, Assembler, RPG III/400, PL/I, etc. - I've also written many technical books (Inside C#, Extending MFC Applications with the .NET Framework, Visual C++.NET Bible, etc.) and 100+ online articles.


    IT Offers


    Top Authors