Suppose you’re using Visual Studio 2008 and you’ve just found out that Microsoft added unit test support for the Compact Framework on devices and emulators. Neat-o!
So you add one to your project thinking, this’ll be fantastic.
Then it doesn’t work.
You get the following cryptic error:
Unable to set TestContext property for the class {class}. Error: System.ArgumentException: Object of type 'Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapterContext' cannot be converted to type 'Microsoft.VisualStudio.TestTools.UnitTesting.TestContext'
“So,” you think, “I obviously did something wrong, but it’s not apparent to me what I did. I will check the Google.”
But Google only shows you what to do for the full framework.
Maybe it’s your project that’s screwed up. So you start a new one to see if it works. It doesn’t, but you get a different error: References root node unavailable. You might as well search the google for that one and then you get this forum post that repeats the solution over and over:
Restart the IDE.
You figure it can’t hurt, so you try it.
And it works.
You can now use unit tests for .NET CF projects, but you’re no longer smiling about it.