In addition to making announcements, showcasing features, posting walkthroughs, and sharing Visual Studio tips and tricks, we’ll also be using this blog to raise awareness of commonly-encountered bugs and explain their workarounds.  As many of you know, we’ve rebuilt the editor using WPF for Visual Studio 2010.  This allows for a wealth of new visualizations and enables many new extensibility scenarios, often making previously impossible tasks possible and previously difficult tasks much easier.  However, because WPF renders only TrueType fonts, it also means that the Visual Studio editor no longer supports raster or bitmap fonts.

The Bug:
Attempting to use a non-TrueType font in Visual Studio 2010 Beta2 throws an exception when opening a file, usually with the message “Object reference not set to an instance of an object.”  The editor will not load.

The Workaround:
In Tools->Options->Environment->Fonts and Colors, change any raster or bitmap font settings to a TrueType font, or simply click OK to have any raster fonts fall back to the default font (Consolas on English systems).  The editor should then load correctly.

Fix Status:
Already fixed for Visual Studio 2010 RTM.

The most common way to encounter this bug is to import settings that include a non-TrueType font from a previous version of Visual Studio.  Running "devenv /resetuserdata" will also resolve the issue, though it will reset all of your settings to the defaults and therefore change more of your preferences than is necessary to fix the problem.  This bug has already been fixed for VS 2010 RTM, where importing or selecting a non-TrueType font will cause the editor to fall back to the default font (Consolas on English systems) and load successfully instead of throwing an exception.

We also discovered that although most bitmap fonts were removed from the default Fonts and Colors list, we inadvertently missed a few.  They are:  Courier, Fixedsys, Modern, MS Sans Serif, MS Serif, Roman, Script, Small Fonts, System, and Terminal.  These fonts have already been removed from the default list for VS 2010 RTM.

Again, this is a bug in Visual Studio Beta2 that has already been fixed internally for VS 2010 RTM.  If you have any questions about this bug or its workaround, please feel free to post a comment below and we’ll do our best to help.

Thanks for trying Visual Studio 2010 Beta2!

Brittany Behrens
Program Manager, Visual Studio Editor Team