Skip navigation

Category Archives: Visual Studio

Have you ever noticed weird behavior while debugging? Sure you have, but have you ever seen something like this in a C# file?

Debugging a class with a bad file name

Noticed the hex values instead of what you expect? Looks a lot like debugging C++, doesn’t it? Breakpoints don’t seem to be hit neither, you have to step into the code manually.

If this is happening to you, please do check your file name. Chances are that you are debugging a generic class and have the habit of making this clear in the file name, e.g. MyGenericClass`1.cs.

This behavior appears to be a known bug in Visual Studio 2008 (don’t know about 2005). VS is unable to determine the programming language for files that are named with a grave accent…

I can tell you, this has driven me mad for quite a while!

I’ve change my habit into using MyGenericClass`T.cs, not exactly what I want but at least the file name makes clear it’s a generic class and I can still debug! You can find more details on the issue on the MS connect site.

Follow

Get every new post delivered to your Inbox.