VS 2010: unable to unit test
I poste开发者_运维百科d this on MSDN as well but this community usually is much more helpful:
http://social.msdn.microsoft.com/Forums/en-US/vsunittest/thread/9a2717c7-4d24-4940-b5be-2bc3df6d7c7d
In a nutshell, VS refuses to start the testing agent. The machine is restarted to make sure nothing is in its memory. In other words, VSPerfMon is NOT running and hasn't been run prior.
Any help is welcome.
The problem magically disappeared :( Darn it... Bunch of people experience this every day and there is no answer.
The important portion of the error messages you're seeing is this:
Failed to get agent process proxy: System.NullReferenceException: Object reference not set to an instance of an object.
Any time you see a message containing the key phrase Object reference not set to an instance of an object in Visual Studio (or in an event log message originating from Visual Studio) you should read it like this:
Visual Studio integration of this feature has been implemented somewhere on the scale between 'weak' and 'craptacular'. Shut down Visual Studio, all other processes, reboot the machine, restart Visual Studio, and hope for better results next time. Or maybe the time after that. Sorry.
It's just such an enormous product that there's going to always be portions of it that aren't really implemented well. Those pieces will always stick out badly from an otherwise excellent piece of software.
I was able to solve this by removing all of the meta data test files and those with testing extensions in the top level solution directory.
After many failed attempts to run unit tests, deleting my bin/obj folders, and resetting my machine -- this is the only solution that allowed my tests to run.
look in your list of running processes. If you have something running called (if memory serves) VSPerfMon ... kill it and try to run your tests again.
精彩评论