You can also run into this if you're working on a WPF project that was started in VS 2010 (Beta 1), then moved into VS 2008.
Under the project properties, the .NET framework version gets unset (since .NET 4.0 isn't valid in VS 2008), and for some reason that causes this error.
If you set the .NET framework (e.g. to .NET 3.5), the error goes away.