Errors when Running VS 2005 Unit Tests

[To keep things on the up and up: I am using beta software and it looks like this is fixed in the release. I am still going to complain because I am still using the beta so I can integrate with Team System.]

Here's a fun one. When you go to run tests in VS 2k5 occasionally an error dialog pops up. The text of the dialog says "Operation is not valid due to the current state of the object." Here's a screenshot:

error dialog box

As if there is only ever one object that has state. And I know which object that is, and how to fix things.

So, how to fix this problem - delete your ProjectName.suo file. First close VS, then delete it, then open your project again. The .suo is regenerated, and you can then run the test. Here is where I found the solution (with thanks to Jeff G. for help on this one.)

Comments

No Comments

Leave a Comment

(required )  
(optional )
(required )  

Enter the numbers above:
Add Comment