MS Unit测试抛出警告-----运行测试开始------ System.AppDomainUnloadedException:尝试访问已卸载的AppDomain。如果测试开始一个线程但没有停止它,就会发生这种情况。确保测试启动所有线程 [英] MS Unit test throws warning ----- Run test started ------ System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain. This can happen if the test(s) started a thread but did not stop it. Make sure that all the threads started by the test

查看:453
本文介绍了MS Unit测试抛出警告-----运行测试开始------ System.AppDomainUnloadedException:尝试访问已卸载的AppDomain。如果测试开始一个线程但没有停止它,就会发生这种情况。确保测试启动所有线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,


我们在Visual Studio 2015 enterprise和.NET framework 4.5.2下开发了单元测试项目。在执行为访问Web套接字端口的库开发的测试时,我得到了以下警告。



-----运行测试开始 - ----
$
System.AppDomainUnloadedException:尝试访问已卸载的AppDomain。如果测试开始一个线程但没有停止它,就会发生这种情况。确保测试启动的所有线程在完成之前停止。
$
System.AppDomainUnloadedException:尝试访问已卸载的AppDomain。如果测试开始一个线程但没有停止它,就会发生这种情况。确保测试启动的所有线程在完成之前停止。
$
==========运行测试完成:1次运行(0:00:06.2894172)= =========



知道怎么摆脱这个吗?









如果这篇文章回答你的问题,请点击标记为答案。如果这篇文章有用,请点击
标记为有帮助。

解决方案

我们在Visual Studio 2015企业和.NET framework 4.5.2下开发了单元测试项目。在执行为访问Web套接字端口的库开发的测试时,我收到了以下警告。


什么时候测试不是单元测试?


http://www.artima.com/weblogs/viewpost。 JSP?螺纹= 126923


Hello All,

We have developed unit test project under Visual studio 2015 enterprise and .NET framework 4.5.2. I am getting below warning when executing tests developed for libraries which are accessing Web socket ports.

----- Run test started ------
System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain. This can happen if the test(s) started a thread but did not stop it. Make sure that all the threads started by the test(s) are stopped before completion.
System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain. This can happen if the test(s) started a thread but did not stop it. Make sure that all the threads started by the test(s) are stopped before completion.
========== Run test finished: 1 run (0:00:06.2894172) ==========

Any idea how to get rid of this ?



If this post answers your question, please click Mark As Answer. If this post is helpful please click Mark as Helpful.

解决方案

We have developed unit test project under Visual studio 2015 enterprise and .NET framework 4.5.2. I am getting below warning when executing tests developed for libraries which are accessing Web socket ports.

When is a test not a unit test?

http://www.artima.com/weblogs/viewpost.jsp?thread=126923


这篇关于MS Unit测试抛出警告-----运行测试开始------ System.AppDomainUnloadedException:尝试访问已卸载的AppDomain。如果测试开始一个线程但没有停止它,就会发生这种情况。确保测试启动所有线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆