gpt4 book ai didi

visual-studio-2008 - Visual Studio 单元测试无法启动

转载 作者:行者123 更新时间:2023-12-04 16:02:45 24 4
gpt4 key购买 nike

在 Visual Studio 2008 Team Test 的 Debug模式下启动测试时出现问题,出现以下错误:

“无法将测试运行 '{user@machinename}' 排队:未将对象引用设置为对象的实例。”

我用谷歌搜索错误但没有快乐。甚至不明白它是什么意思,因为它太简短了。有没有人遇到过这个?

请注意,如果我不调试,我可以很好地运行测试,并且无论我运行什么测试都会得到相同的错误。

谢谢,

斯瓦蒂

预计到达时间:

作为 Visual Studio Team Test 的新手,我不知道有比我看到的更好的异常日志。无论如何,这里是:

<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>

最佳答案

在使用 VS 2008 测试引擎时,您可能会遇到由计算机名称中的小写字符引起的(小)已知错误;见 here有关它的一些信息。我们花了数周时间才在我的一个项目中找到它,但在我能找到的任何地方的文档中仍然不容易找到它。

问题出在 VS 测试引擎中,如果计算机名称包含任何小写字母,就会出现问题。测试引擎在运行时将计算机名称转换为全部大写字母,这会导致内部字符串比较失败并导致与您所描述的类似的错误消息。

您可能会也可能不会遇到同样的问题,但是如果您的计算机名称有任何小写字母,请尝试将名称更改为全大写版本,然后看看会发生什么......

关于visual-studio-2008 - Visual Studio 单元测试无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2311847/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com