2

I use VS 2008 professional, and use Unit tests.

Sometimes, I get the error: Error: "Exception has been thrown by the target of an invocation."

http://peitor.blogspot.com/2009/10/sometimes-it-works-sometimes-not.html

What I did and didn’t help:

Start up Visual Studio in safe mode (parameter /SafeMode ) Start up Visual Studio and reset user data (parameter /resetuserdata ) I do this “devenv /safemode”, “Open solution”, “Build”, “Clean”, “Rebuild”, “Cross fingers”, “Run all tests”…

No solution... :'( it's nightmare..

Any solutions, please ????

Alhambra Eidos
  • 1,515
  • 4
  • 21
  • 31
  • 1
    That exception message usually means that there is at least one nested exception which can tell you what exactly went wrong. You might want to look whether the complete exception including inner exceptions can be found somewhere (the message box obviously doesn't tell you anything). – Joey Nov 13 '09 at 13:18

5 Answers5

8

Open Team Explorer and connect to your TFS server. Then try again.

From the first comment on Chezray's blog post. The author himself doesn't have the solution, but the commenter does.

Michael L Perry
  • 7,327
  • 3
  • 35
  • 34
1

I am using Visual Studio 2010. I changed the Source Control Setting from AnkhSVN to None and it started working fine.

0

What worked in my case was going to Test -> Test Settings -> Default Processor Architecture in the VS menu and toggling the processor architecture from x86 to x64.

Paul Orland
  • 542
  • 4
  • 16
  • I am using VS2012 Ultimate with a integrate service project. This toggling from x86 to x64 did not work for me. – bsivel Mar 24 '15 at 17:08
0

I set Source Control Setting from AnkhSVN to None. Still didn't work. Closed and re-opened VS a couple times. Still didn't work. Noticed my start-up project was the actual test project. Changed the start-up project back to the "Application" and ran it. Then I ran the tests and that annoying message box went away.

A very ambiguous error, indeed.

hmcclungiii
  • 1,765
  • 2
  • 16
  • 27
0

I connected to TFS first. Then I closed and reopened Visual Studio which worked for me.

spins3
  • 33
  • 5