[If you don't know what WPF is, it's Microsoft's new UI framework called: Windows Presentation Framework. Here is a good link for learning about WPF basics.]
I'm a self confessed WPF rookie so this trick is something that I learned this weekend while trying to get my first WPF control library to build. In my ignorance, I started my project as a Windows custom control library, like this:

Everything seemed fine as I created a WPF page and added it to the library, then I tried to compile. This is the error that I got:

That little error kept me busy for about an hour.
So anyway, the lesson I learned is that in order to create a WPF custom control library one should start by first opening the "Visual C#" node in the "New Project" dialog, then select the ".NET Framework 3.0" project type, then select the "Custom Control Library (WPF)" project template type. It should look like this:

Then, when you add your WPF types it will build like it's supposed to.
Oh well, learning new technology is not without it's little perils. Hopefully someone facing this problem will benefit from my frustration.
See ya!