Reputation: 23
I am not able to run my Unit Tests in Visual Studio 2010 due to an error which occurs when I try to Run Test or open any test windows, such as Test > Windows > Test Results. An error message popups up saying "Exception has been thrown by the target of an invocation".
Everything I've read online says it's related to being disconnected from a Team Foundation Server (TFS) but I've never used TFS. I've also heard that closing all instances of Visual Studio and restarting it will help. Tried that. I've also restarted my machine. No luck. I've had this happen a few times in the past as well and I don't know what makes it go away.
Does anyone know what might be causing this?
The solution I'm working in has several projects, including a WCF service, a Window Server, several other libraries and the test project. However, now, when I start Visual Studio without even opening my solution and try to open Test > Windows > Test Results it throws the error.
Upvotes: 1
Views: 7847
Reputation: 1135
instead of deleting entire VisualStudio directory under AppData\Roaming\Microsoft, I just deleted "Team Explorer" inside. now I don't get the exception.
Upvotes: 0
Reputation: 163
I successfully solved this issue by opening the Team Explorer while the was NO project loaded in Visual Studio. Never saw the problem since.
Upvotes: 0
Reputation: 1
After two days of trying, the only solution that work for me was removing the folder C:\Users\xxx\%AppData%\Roaming\Microsoft\VisualStudio\10.0
Upvotes: 0
Reputation: 7193
I was getting this error when I start the second IDE of VS 2010/2012 but when I restart the explorer.exe it works very fine.
Open task manager
Now start VS. I hope you won't get any error.
Upvotes: 4