Failed to start Visual Studio Unit Test

I have a problem when running tests in debug mode in Visual Studio 2008 Team Test, where it gives the following error:

"Failed to start test run {user @machinename} ': The object reference was not installed in the object instance."

I was looking for a mistake, but not joy. I don’t even understand what this means, because it is too short-lived. Has anyone come across this?

Please note that I can run tests normally if I am not debugging and getting the same error no matter which test I run.

Thanks,

Swazi

ETA:

Being new to Visual Studio Team Test, I did not know that there was a better error log than what I saw. One way or another, here it is:

<Exception> System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.VisualStudio.TestTools.TestCaseManagement.QualityToolsPackage. ShowToolWindow [T](T&amp; toolWindow, String errorMessage, Boolean show) at Microsoft.VisualStudio.TestTools.TestCaseManagement.QualityToolsPackage. OpenTestResultsToolWindow() at Microsoft.VisualStudio.TestTools.TestCaseManagement.SolutionIntegrationManager. DebugTarget(DebugInfo debugInfo, Boolean prepareEnvironment) at Microsoft.VisualStudio.TestTools.TestManagement.DebugProcessLauncher.Launch( String exeFileName, String args, String workingDir, EventHandler processExitedHandler, Process&amp; process) at Microsoft.VisualStudio.TestTools.TestManagement.LocalControllerProxy.StartProcess( TestRun run) at Microsoft.VisualStudio.TestTools.TestManagement.LocalControllerProxy.RestartProcess( TestRun run) at Microsoft.VisualStudio.TestTools.TestManagement.LocalControllerProxy.PrepareProcess( TestRun run) at Microsoft.VisualStudio.TestTools.TestManagement.LocalControllerProxy. InitializeController(TestRun run) at Microsoft.VisualStudio.TestTools.TestManagement.ControllerProxy.QueueTestRunWorker( Object state) </Exception> 
+6
unit-testing visual-studio-2008
source share
2 answers

Perhaps you are using a small known error caused by lowercase characters in the computer name when using the VS 2008 test mechanism; see here for some info on this. It took us weeks to figure this out in one of my projects, and it's still not easy to find anywhere in the documentation that I can find.

The problem is with the VS test module and occurs if the computer name contains any lowercase letters. At startup, the test engine converts the computer name to all uppercase letters, which causes internal string comparison to fail and leads to similar error messages regarding what you are describing.

You may or may not have the same problem, but if your computer name has lowercase letters, try changing the name to the entire uppercase version, and then see what happens ....

+1
source share

This is a long snapshot, but I had a similar error message, and it turned out that my Unit tests were set to "x86" in the configuration manager.

As soon as I changed it to the target “Any processor”, all this worked fine.

Maybe you should look at what your Unit Test project is set up for.

0
source share

All Articles