Monday, March 19, 2007

My Visual Studio Text Editor

At work, I find myself spending most of my time using Microsoft Visual Studio 2005. I realized that a long time ago, that I was incredibly bored of the default text editor settings:

Now I've gotten used to changing three text editor settings after each time I install Visual Studio:

1) I change the text editor font. I hate the default Courier New font - it's so boring and tires my eyes. I change it to something a little more to my taste, such as Consolas (which looks really good with ClearType turned on). You can change the font under Tools->Options...->Environment->Fonts and Colors.

2) I then turn on line numbers. I personally think this should be on by default. You can turn this on by going to Tools->Options...->Text Editor->C#->General. (this obviously also works with other source code types such as C++).

3) The last thing I do is set a line guide in the text editor. The feature for some reason isn't available via the Visual Studio interface and requires you to add this in the registry:

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\Text Editor]
"Guides"=RGB(0,128,0)60

This will draw a line in your text editor the color of the RGB value specified (in my case green) and the last number is the column number you want the line at. Mine is at 60 for the screenshot below:







Thursday, March 15, 2007

COM interop assemblies and versioning

At work today, I was assigned a bug because of a COM interop assembly I had created. To create it, our build environment was using tlbimp.exe. It needed to be able to take a resource file that contained the version information, however tlbimp doesn't allow you to do this (only allows you to statically specify). I found a way around this thanks to IanWho. Basically, you need to follow the following steps.

1) Create your COM interop assembly with tlbimp.exe.
2) Compile your resource file.
3) Disassemble the interop assembly with ildasm.exe. This breaks it down to its simple proteins (the IL code).
4) Reassemble the interop assembly with ilasm.exe, using the /res switch to have it include your compiled resource file.

This worked for me and after I was done it reminded me of the movie "The Fly".

Monday, March 12, 2007

ellboy.com 2.0

I almost came to the point of forgetting that I had my own domain name called ellboy.com. After typing it into my web browser, I forgot that I had a Blogger account. After looking through the blog, I realized how useless it is. I almost - keyword ALMOST - deleted it. But I have to have a blog - I can't be a geek without one. Maybe this time it won't be so sucky.