简体   繁体   English

VS2010中的单元测试(发布模式下的解决方案)

[英]Unit tests in VS2010 (solution in release mode)

I am trying to run my unit tests (Test->Debug->Tests in current solution) in VS 2010. The solution is built in Release mode. 我试图在VS 2010中运行我的单元测试(当前解决方案中的Test-> Debug-> Tests)。该解决方案以发布模式构建。 When I try to do that, VS is crashing. 当我尝试这样做时,VS崩溃了。

Do you have any ideas? 你有什么想法?

Cheers 干杯

I guess the problem lies with the test code. 我猜问题出在测试代码上。 Test code is crashing and bringing down the VS IDE too. 测试代码崩溃了,并且也降低了VS IDE。

See while debugging, the tests are run in-proc and therefore because of any exception in test code the VS would crash too. 请参阅调试时查看,测试将在过程中运行,因此由于测试代码中的任何异常,VS也将崩溃。

I would suggest that you set the "Break on Common language runtime exceptions" (Goto Debug -> Exceptions menu), and then debug the tests. 我建议您设置“公共语言运行时异常中断”(转到调试->异常菜单),然后调试测试。 That way you could hunt the exception in your test code. 这样,您可以在测试代码中搜寻异常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM