Tuesday, March 21, 2006

VS 2005, File Templates, Snippets

So I FINALLY got my own copy of Visual Studio 2005 Professional, and it was a good deal too (thanks to a friend). I got some free CTP drops a while back that I played with, and beta 2, but when the real thing came out I had to stick with the Express edition at home (it was pretty nice, actually). At work, however, I spend just about all day in VS 2005 Professional. Anyway, it's nice to have my own copy. And it even came with a pretty handy book.

One thing that I'm going to end up spending quite a bit of time on is customizing and extending VS. Doesn't that sound like fun? Today I spent time with file templates and snippets.

Ever want to edit the default file templates? Of course you do. I wanted to because I'm doing some 1.1 work using the 2.0 studio, so I had to write code that was backwards compatible. This means no generics. And, of course, what namespace shows up in the default class file template for C#? System.Collections.Generic. So I wanted to take that out.

You would think you would go to the "C:\Program Files\Microsoft Visual Studio 8\VC#" area. That's where snippets are. Nope. You might also think that you go to "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\CSharp\1033". Nope, but you're warmer. You actually go to "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplatesCache\CSharp\1033". You can change those files, and the changes should be applied next time you restart VS.

So, what about snippets? That's when you go to "C:\Program Files\Microsoft Visual Studio 8\VC#\Snippets\1033\Visual C#". Snippets are Xml based files, but it is pretty easy to understand what is going on. Edit those files, restart visual studio, and presto!

The hotkey combo for snippets in VS is pretty awkward, Ctrl+K, Ctrl-X. I'm trying to think of something a little easier on the fingers, because I am trying to snippet things more and more.

BTW, if you haven't used snippets in VS 2005, take a look at them. They can be useful.

Significantly Stressful Times...

...lately. I have been so incredibly distracted. Back to making this my super-cool coding blog, now that I've made this split.

For those who haven't figured it out yet, I have split my blog. Biblical studies stuff goes here.

Friday, March 17, 2006

Can't...Move...Blog...

Anybody else having trouble having blogger ftp your entire blog to another host? I finally registered www.thecodinghumanist.com. I want to move my blog there. Blogger keeps erroring out every time I try to publish the site to the new server. It always stops somewhere in the process (sometimes as low as 1%; the highest I've gotten is in the 70% range). I find this very annoying.

The new site is up, but incomplete. It will be my tech-geek home. Maybe I can get this to work. I don't want to shell out more cash for sql server hosting so I can setup community server there or something like it...