March 28, 2007

NAnt-NUnit error

Ever have a weird error and there is nothing on Google to help you? This was one of those problems.

We are using nant to run all of our builds, and using the NUnit2 for testing. Just to help out, nant has a task called nunit2.

Unfortunately, every time I ran our build I would recieve this error:
[loadtasks] Failure scanning "C:\Program Files\nant-0.85\nant-0.85\bin\NAnt.NUnit2Tasks.dll" for extensions. Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
That could have been a bit more helpful.

Fortunatly Reflector was able to save the day. I was able to find the NAnt.NUnit2Tasks.dll on my file system (not to hard, the error message told me right where to find it), and loaded it into Reflector.

From there I checked the references of the dll. Two caught my eye. nunit.core and nunit.util. Still using resharper I tried to expand the references...Resharper could not find them. And they did not exist in the same directory as NAnt.NUnit2Tasks.dll. That meant that nant was looking for them in the GAC and they were not there!

A quick little script proved that to be true. It looked like this:
gacutil.exe /l nunit.util

I received this message:
The Global Assembly Cache contains the following assemblies:

Number of items = 0

OK, enough debugging, I ran the following two scripts to put those two dlls in the GAC and everything worked fine:

C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin>gacutil.exe /i "C:\Program Files\NUnit-Net-2.0 2.2.8\bin\nunit.core.dll"

C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin>gacutil.exe /i "C:\Program Files\NUnit-Net-2.0 2.2.8\bin\nunit.util.dll"

No thanks Google, I'll just fix it myself thank you very much.

March 27, 2007

Geek Coffee Mug

I finally found a coffee mug that truly represents me.










I wish more swag was like this. So I got two. One for me, and one for a developer group give-a-way.

Just another way of proving this mug was made for me.

Big anouncement at MIX07

For the love of Pete! What is this super duper announcement that Microsoft is going to finally tell us about at MIX07! I can't wait another month for this!

At least that is what I would say if I wasn't up to my eyeballs in work right now.

ReSharper UnitRun

I'm all in favor of good tools when I can find them, even better when they are free (as this one appears to be).


But JetBrains has released ReSharper UnitRun for down.
http://www.jetbrains.com/unitrun/

If you already use ReSharper you know how good of a tool this is already.
If you don't user ReSharper, this is one of the best features in it (next to automatic code profiling).

So, if you are doing Test Driving development, check it out, it is worth the download.

March 23, 2007

PLinq out of the bag

First off, a definition: PLINQ is Parallel LINQ. It allows you to run LINQ commands in parallel with minimal effort.

I didn't know this was out of NDA yet, but I just saw some links on MSDN's C# Developer Center.

PLINQ is being discussed in the wild!

I first heard about this at Microsoft's MVP Summit in a talk that Anders Hejlsberg was giving. It was probably one of two of the coolest things I saw at the MVP Summit (and the other will have to wait a while longer before I talk about it here).

Anyway, here are a few more links I've found on PLINQ:
http://themechanicalbride.blogspot.com/2007/03/dreaming-of-plinq.html
http://www.bluebytesoftware.com/blog/PermaLink,guid,81ca9c00-b43e-4860-b96b-4fd2bd735c9f.aspx
http://www.eweek.com/article2/0,1759,2009167,00.asp?kc=EWRSS03119TX1K0000594

I will be posting more about this later.

March 22, 2007

An Open Letter to Scott Guthrie on Elegant Code

OK, this post is just too good. Even better since I know the guy posting it.


It is a really worth a read: http://elegantcode.com/?p=539

Visual Studio.Net Short-cut: Format Document

OK, here is another nice short-cut: Format Document

Ctrl-k, Ctrl-d

Same as last time, this is a cord. You have to hit both in series.

There is another way to do this, btw. In C#, find the last '}', delete it, and re-type it.

And because I can't seem to just blog on short-cut at a time...

Surround With Snippets:
Ctrl-k, Ctrl-s

This brings up the list of snippets that can surround the current code with another code block. Ex. Try-Finally, While, Foreach, etc. Note: this even works with Resharper installed.

March 21, 2007

Visual Studio.Net tool I didn't know about

One of those things I have long believed is there is potential for really cool things to be hidden in the Visual Studio.Net IDE and I wont know about them.

I found out it was very true last week. Someone introduced me to "Code Definition Window" (shortcut Ctrl-\, Ctrl-d).

You probably already know about the right-click option Go to Definition. This does that one better. It is a tool window that displays the definition of whatever your cursor is on in a read only window.

It is kind of like the second code window you always wanted.

Selenium and IIS7

We had a minor victory this morning. We finally got Selenium working under IIS7.

Apparently Selenium doesn't like IIS7's new managed pipeline. Neither does Reporting Services 2005 -- but that is another story.

So the fix: Open up the IIS Manager (InetMgr.exe), open up "Application Pools", you should see DefaultAppPool. Double-click it. The last option on the dialog should be "Managed pipeline mode", select classic (it should be Integrated by default).

You can read about what changed in the March 2007 issue of MSDN Magazine article: Explore The Web Server For Windows Vista And Beyond (http://msdn.microsoft.com/msdnmag/issues/07/03/IIS7/)

Skip down to ASP.NET Integration so see how the pipeline has changed.

The real nice thing is that with IIS7, yes they made a number of changes that seem to break a number of web application, but they did give us a way back.

Vistual Studio.NET shortcuts of the day

I got this neat handout from Microsoft the other day with a "complete" list of Visual Studio.NET shortcut commands. And I am all in favor of not having to reach for the mouse.

So here are my two favorite Refactoring shortcuts:
First a note of warning, these command are chords. Meaning, you hit the first command, and then the second command to get it to work. This is actually kind of nice, all of the refactoring commands are grouped under a Ctrl-r. So to do a Refactor.Rename, you hit Ctrl-r, then Ctrl-r again.

Anyway, here is the list:

Ctrl-r, Ctrl-r: Rename

Ctrl-r, Ctrl-e: Encapsulate Field (turn a private variable into a public property)

Ctrl-r, Ctrl-i: Create an interface for the current class

Ctrl-r, Ctrl-m: Extract Method

Four is enough for one blog post I think. Any more than that and I would overwhelm you with them. So, learn these and I will post more later.

March 11, 2007

Off to the MVP summit

The good: I get to go to Microsoft's MVP Summit and I leave tomorrow.
The Bad: I probably wont be able to talk about it because I'll be under NDA.
The Ugly: Well, I'm not expecting a lot of pretty faces at an event like this.

Anyway, it should be a fun time, and I'm hoping to see some people I've only "met" in blogs. And yes, there is a difference.

As for imagery, think of a hobbit trying to rub shoulders with a giant. And I'm not a giant. :)