VS 2010:无法进行单元测试

发布于 2024-10-07 14:09:01 字数 369 浏览 2 评论 0原文

我也在 MSDN 上发布了此内容,但这个社区通常更有帮助:

http://social.msdn.microsoft.com/Forums/en-US/vsunittest/thread/9a2717c7-4d24-4940-b5be-2bc3df6d7c7d

简而言之,VS拒绝启动测试代理。重新启动计算机以确保其内存中没有任何内容。换句话说,VSPerfMon 没有运行并且之前也没有运行过。

欢迎任何帮助。

I posted this on MSDN as well but this community usually is much more helpful:

http://social.msdn.microsoft.com/Forums/en-US/vsunittest/thread/9a2717c7-4d24-4940-b5be-2bc3df6d7c7d

In a nutshell, VS refuses to start the testing agent. The machine is restarted to make sure nothing is in its memory. In other words, VSPerfMon is NOT running and hasn't been run prior.

Any help is welcome.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

感受沵的脚步 2024-10-14 14:09:01

问题神奇地消失了:(该死的......很多人每天都会遇到这个问题,但没有答案。

The problem magically disappeared :( Darn it... Bunch of people experience this every day and there is no answer.

稀香 2024-10-14 14:09:01

您看到的错误消息的重要部分是:

无法获取代理进程代理:System.NullReferenceException:未将对象引用设置为对象的实例。

每当您在 Visual Studio 中(或源自 Visual Studio 的事件日志消息中)看到包含关键字未将对象引用设置为对象实例的消息时,您都应该像这样阅读:

Visual工作室对该功能的集成已经在“弱”和“糟糕”之间的范围内实现。关闭Visual Studio,所有其他进程,重新启动机器,重新启动Visual Studio,希望下次有更好的结果。或者也许在那之后的时间。对不起。

这是一个如此庞大的产品,其中总会有一些部分没有得到很好的实施。这些部分总是会与其他优秀的软件相比显得非常突出。

The important portion of the error messages you're seeing is this:

Failed to get agent process proxy: System.NullReferenceException: Object reference not set to an instance of an object.

Any time you see a message containing the key phrase Object reference not set to an instance of an object in Visual Studio (or in an event log message originating from Visual Studio) you should read it like this:

Visual Studio integration of this feature has been implemented somewhere on the scale between 'weak' and 'craptacular'. Shut down Visual Studio, all other processes, reboot the machine, restart Visual Studio, and hope for better results next time. Or maybe the time after that. Sorry.

It's just such an enormous product that there's going to always be portions of it that aren't really implemented well. Those pieces will always stick out badly from an otherwise excellent piece of software.

眼藏柔 2024-10-14 14:09:01

我能够通过删除所有元数据测试文件以及顶级解决方案目录中具有测试扩展的文件来解决此问题。

在多次尝试运行单元测试失败后,删除我的 bin/obj 文件夹并重置我的机器——这是允许我的测试运行的唯一解决方案。

I was able to solve this by removing all of the meta data test files and those with testing extensions in the top level solution directory.

After many failed attempts to run unit tests, deleting my bin/obj folders, and resetting my machine -- this is the only solution that allowed my tests to run.

蓝眼泪 2024-10-14 14:09:01

查看正在运行的进程列表。如果您正在运行名为(如果没记错的话)VSPerfMon 的东西...杀死它并尝试再次运行您的测试。

look in your list of running processes. If you have something running called (if memory serves) VSPerfMon ... kill it and try to run your tests again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文