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.
- 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
- 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 KbAbout 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
More for Developers
Top Authors
- Voted: 13 times.
- Voted: 11 times.
- Voted: 11 times.
- Voted: 8 times.
- Voted: 8 times.
- Paul Kimmel 214 articles
- Zafir Anjum 120 articles
- 15Seconds.com 99 articles
- Tom Archer - MSFT 83 articles
- Jeffrey Juday 82 articles


All