I was debugging some code in Visual Studio 2005, when I noticed that the IDE was not hitting breakpoints in a particular generic class. I could manually step into the class, but the tool-tips shown when hovering over references contained nothing but memory addresses instead of the normal friendly tool-tips.
It turns out that the problem is caused by the name of the file (!). Specifically, when the file name contains a ` (backtick, backquote), the debugger will not load the symbols for that file. The workaround is to rename the file.
I was using a backtick in the first place to represent the cardinality of a generic type:
- Foo.cs contains a non-generic type (e.g. Foo)
- Foo`1.cs contains a generic type with a single type parameter (e.g. Foo<T>)
- Foo`2.cs contains a generic with two type parameters (e.g. Foo<T,U>)
This bug (is it?) occurs in Visual Studio 2008 as well.
Can anyone explain this behavior?