Debug into the .NET Framework Source Code

by Tobias Hertkorn on January 17th, 2008

As promised Microsoft did actually release the .NET Framework Source Code for us developer to seamlessly step through. Awesome!

Read more about how to configure VS to load symbols for the framework at Shawn Burke's Blog.

All I need now is a debug shortcut that let's me choose if I want to enable the symbol server or not. Something like: hit F5 and VS ignores the symbol server and lets me only debug my local sources (= behave as if "Enable Just My Code" is checked and "Enable source server support" is not checked). That should be the default scenario, because 99% of debugging is actually debugging something I broke. But I also want a shortcut like Shift+F5 (which currently is Debug.Stop) which loads all needed symbols on starting the debugging (= behave as if "Enable Just My Code" is not checked and "Enable source server support" is checked, plus "Search the above locations only when symbols are loaded manually" is NOT checked). That way I could step into

C#:
  1. FileInfo fi = new FileInfo(filename);

by means of F11 without the need of a Call Stack or manually adding the symbols. Which would be handy, if there is an exception coming out of the framework that I don't understand (the other 1% of debugging).

Well, whatever. Now I switch the behaviour manually, which is just fine. Because today I did play a bit with the source view of the framework. But I didn't really need it (yet). We'll see.

Oh, and I would really, really love it if you could include symbols for System.ServiceModel very, very soon. :-) Because unfortunatelly it is not included yet, and for me it has been the source of most exception that I did not understand.

January 17th, 2008 7:51 am | Comments (0)

I hate and loath the Visual Studio Conversion Wizard

by Tobias Hertkorn on January 9th, 2008

Well, at work (and at home) I have moved to Visual Studio 2008 quite some time ago. But there simply are a lot of solutions and projects around from the pre 2008 era. Not just in our (or my) source control, but almost any OS project on the web has not moved to 2008 (yet). And there are loads of examples that are still using 2003 solutions.

So any time I come across one of those I always wince. Just the thought of going through the next few steps, just the anticipation gives me a serious headache every time. Because noooo, I can't just double click on the solution and be done with. Nope, somebody at Microsoft was clever and managed to version brand those solutions. So if I can't catch the little 8 instead of the 9 in the icon (!) of the solution file ... my visual studio 2005 will open. Argh. So now that guy managed to brand me into "look really, really close at the icon, dude". And I don't like that. I want to have a SETTING that overrides this stupid behavior. It just does not make sense to me. Because the only option to turn off that behavior is - to uninstall VS2005. :-D Well, that's number one of the settings I am really, really missing. But that's not even the worst part, I can reason with that - it's a cross program behavior and maybe they don't want to mess with that.

What I really don't get is that there still is no way to default the hidious Visual Studio Conversion Wizard to

  • Don't show up. (I really, really don't care)
  • Convert without backup. (who needs a backup in the age of source control)
  • ... and don't bother with the little check mark about "Show the conversion log when blablabla". If I want to see it I KNOW WHERE TO FIND IT.

Stupid Dear Visual Studio Conversion Wirzard: Please, please, pretty please, do only EVER pipe up if there actually was an error. No, actually, even then, don't pipe up. In that case just silently open the conversion log. I'll KNOW what you mean by it. And oh, if you find a reference to a 2008 csproj file in a 2005 sln THAT does NOT count as an error. Be happy that you DON'T have to do ANYTHING about it and walk away.

Please Visual Studio Conversion Wizard Writing Guy, please save my time and my nerves and implement a little tiny minuscule setting to make me happy. Please. The VS migration experience would really benefit.

January 9th, 2008 9:05 pm | Comments (6)

Error while adding attributes in EnvDTE

by Lars Hildebrandt on January 9th, 2008

In my Codegeneration-Addin for Visual Studio 2008 i tried to add an attribute to my generated getter and setter with the method "AddAttribute"

C#:
  1. CodeFunction getter = prop.Getter;
  2.   getter.Attributes("MyAttribute", "myValue", -1);

At runtime I get an error with the nice message "Unbekannter Fehler" (unknown Error). It seems that the error only appears at getter/setter (CodeFunction). At "CodeProperty" and "CodeClass" everything works fine. Strange.

January 9th, 2008 12:27 am | Comments (0)

The flashing Code Definition Window

by Tobias Hertkorn on January 4th, 2008

Have you ever used the Code Definition Window in VS 2005/2008? If you have not, I strongly suggest you try it out. It is a feature that is 4 years old, but still manages to amaze me and is a true help while coding. You will find yourself hitting F12 less and less. Especially when you are coding using multiple monitors. Me for example, I have the Code Definition Window as a floating window on my second monitor.

Why do I bring up that feature now? Well, lately I have gone to the dark side of VS. (Btw I nearly pissed myself when I found that URL while writing this post! Great humor, Darius.)

"Is the dark side stronger?" "No, no, no. Quicker to code, easier on the eyes, more seductive." "But how am I to know the good side from the bad?" "When it looks like vim!"

Anyway, it seems as if the Code Definition Window does a screen refresh using the colour white even when a dark background is selected. So now I feel like I am getting photographed every few seconds. :( This is a very annoying bug. And I sure don't know what to do, because I don't want to go back to the light side and using a light background on my current font colours is just not an option either. Damn.

Well, besides that I found out another fun thing; the Code Definition Window even knows how to resolve the new var keyword (at least when there are no anonymous types involved). Fun.

Nothing more will I teach you today. Clear your mind of questions.

January 4th, 2008 7:06 pm | Comments (3)
Tobi + C# = T# - Blogged blogoscoop