AppDomain关闭? [英] AppDomain closing ?

查看:56
本文介绍了AppDomain关闭?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用AppDomain.UnLoad方法(调用Thread.Abort

方法)时,我收到以下错误消息


AppDomain不能被卸载是因为线程1378不能被b
解开它


这似乎需要时间。如果我等了大约30秒,它好像是b $ b似乎要卸载了。

有什么想法吗?

when I use the AppDomain.UnLoad method (which calls the Thread.Abort
method), I get the following error message

AppDomain can not be unloaded because the thread 1378 can not be
unwound out of it

It seems to take time doing this. If I wait for about 30 seconds, it
seems to get unloaded.
Any ideas?

推荐答案

JPSuitor,


嗯,错误非常清楚。什么是线程正在做什么

花了这么长时间?


你不应该依赖这样的突然关机。相反,你应该

信号线程,你知道在该应用域中运行关闭,

然后调用Unload。


希望这会有所帮助。

-

- Nicholas Paldino [.NET / C#MVP]

- mv*@spam.guard.caspershouse.com


" JPSutor" < JP ***** @ yahoo.com>在消息中写道

news:11 ********************** @ f14g2000cwb.googlegr oups.com ...
JPSuitor,

Well, the error is pretty clear. What is it that thread is doing which
is taking so long?

You shouldn''t rely on such an abrupt shutdown. Rather, you should
signal threads that you know are running in that app domain to shut down,
and then call Unload.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"JPSutor" <jp*****@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
当我使用AppDomain.UnLoad方法(调用Thread.Abort
方法)时,我收到以下错误消息

AppDomain无法卸载,因为1378的线程可以不被解开它

这似乎需要时间。如果我等了大约30秒,它好像是卸载了。
任何想法?
when I use the AppDomain.UnLoad method (which calls the Thread.Abort
method), I get the following error message

AppDomain can not be unloaded because the thread 1378 can not be
unwound out of it

It seems to take time doing this. If I wait for about 30 seconds, it
seems to get unloaded.
Any ideas?



Abort()本质上被称为by Unload()。


Willy。


Nicholas Paldino [.NET / C#MVP]" < mv*@spam.guard.caspershouse.com>写在

消息新闻:uu ************* @ TK2MSFTNGP15.phx.gbl ...

| JPSuitor,

|

|嗯,错误非常清楚。什么是线程正在做什么

|花了这么长时间?

|

|你不应该依赖这种突然关闭。相反,你应该

|你知道在那个app域中运行的信号线程要关闭,

|然后调用Unload。

|

|希望这会有所帮助。

|

|

| -

| - Nicholas Paldino [.NET / C#MVP]

| - mv*@spam.guard.caspershouse.com

|

| " JPSutor" < JP ***** @ yahoo.com>在消息中写道

|新闻:11 ********************** @ f14g2000cwb.googlegr oups.com ...

| >当我使用AppDomain.UnLoad方法(调用Thread.Abort

|>方法)时,我收到以下错误消息

| >

| >无法卸载AppDomain,因为线程1378不能是
| >解开它

| >

| >这似乎需要时间。如果我等了大约30秒,那就是
| >好像要卸货了。

| >有什么想法吗?

| >

|

|
Abort() is called intrinsically by Unload().

Willy.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uu*************@TK2MSFTNGP15.phx.gbl...
| JPSuitor,
|
| Well, the error is pretty clear. What is it that thread is doing which
| is taking so long?
|
| You shouldn''t rely on such an abrupt shutdown. Rather, you should
| signal threads that you know are running in that app domain to shut down,
| and then call Unload.
|
| Hope this helps.
|
|
| --
| - Nicholas Paldino [.NET/C# MVP]
| - mv*@spam.guard.caspershouse.com
|
| "JPSutor" <jp*****@yahoo.com> wrote in message
| news:11**********************@f14g2000cwb.googlegr oups.com...
| > when I use the AppDomain.UnLoad method (which calls the Thread.Abort
| > method), I get the following error message
| >
| > AppDomain can not be unloaded because the thread 1378 can not be
| > unwound out of it
| >
| > It seems to take time doing this. If I wait for about 30 seconds, it
| > seems to get unloaded.
| > Any ideas?
| >
|
|




" JPSutor" < JP ***** @ yahoo.com>在留言中写道

news:11 ********************** @ f14g2000cwb.googlegr oups.com ......

|当我使用AppDomain.UnLoad方法(调用Thread.Abort

|方法)时,我收到以下错误消息

|

|无法卸载AppDomain,因为线程1378不能是
|解开它

|

|这似乎需要时间。如果我等了大约30秒,那就是
|好像要卸货了。

|有什么想法吗?

|


当Thread.Abort()超时时,CLR会发出粗鲁的中止行为。这是

CLR的正常行为,系统不能永远等待AD卸载。您的b / b
问题是您的线程在非托管代码中运行或被阻止,您只需要恢复此阻塞线程或确保线程不会停留那么长时间

非托管代码。


Willy。

"JPSutor" <jp*****@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
| when I use the AppDomain.UnLoad method (which calls the Thread.Abort
| method), I get the following error message
|
| AppDomain can not be unloaded because the thread 1378 can not be
| unwound out of it
|
| It seems to take time doing this. If I wait for about 30 seconds, it
| seems to get unloaded.
| Any ideas?
|

The CLR will orce a rude abort when a Thread.Abort() times out. This is the
CLR''s normal behavior, the system can''t wait forever for an AD unload. Your
issue is that your thread runs or is blocked in unmanaged code, all you can
do is resume this blocking thread or make sure threads don''t stay that long
in unmanaged code.

Willy.


这篇关于AppDomain关闭?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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