Thanks for your reply Alan,
Of course, we are able to get the unmanaged thread ID, just call the raw
win32 api through PInvoke, the
DWORD GetCurrentThreadId(void);
WIN32 API just help get the current thread ID. However, since I've
mentioned that the underlying thread is managed by CLR runtime, it'll
schedule a underlying operating system thread to work in different
appdomain, so it is possible that the creation time of the underlying win32
thread is not the start of your webservice method executing point....
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "A.M-SG" <
[email protected]>
| References: <
[email protected]>
<
[email protected]>
| Subject: Re: The thread '<No Name>' (0xdc0) has exited with code 0 (0x0).
| Date: Thu, 1 Dec 2005 13:10:37 -0500
| Lines: 95
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <
[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| NNTP-Posting-Host: 67.71.55.33
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:31005
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
| Hi Steven,
|
| Is there any way to have the "operating system scope thread ID" within my
| web service code?
| I need that to track the creation and destruction of threads within my
web
| method code.
|
| Thank you,
| Alan
|
|
| | > Hi Alan,
| >
| > Welcome to webservice newsgroup.
| > From your description you're encountering some unexpected exeption when
| > calling a asp.net webservice... As for the threadID difference between
| > the
| > IDE debugger output one and the Thread.ManagedThreadID, it is because
the
| > Thread.Managed is an unique ID used by managed world to idenitify a
| > thread execting .net code while the debugger window's threadID maybe a
| > operating system scope thread ID(native thread....), their actual
relation
| > ship is determiend by the internal implementation of CLR and most
probably
| > they're different ....
| >
| > Is your webservice's webmethod doing any particular things which will
| > throw
| > any unhandled exception ?
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure!
www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| >
| >
| >
| > --------------------
| > | From: "A.M-SG" <
[email protected]>
| > | Subject: The thread '<No Name>' (0xdc0) has exited with code 0 (0x0).
| > | Date: Wed, 30 Nov 2005 16:00:19 -0500
| > | Lines: 24
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | X-RFC2646: Format=Flowed; Original
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | Message-ID: <
[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| > | NNTP-Posting-Host: hse-toronto-ppp3485030.sympatico.ca 65.92.98.153
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet.webservices:30985
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
| > |
| > | Hi,
| > |
| > | When I run my web service application in VS2005 IDE and then watch the
| > | output window, almost after any method call, I have something like
this
| > | message in my output window:
| > |
| > | The thread '<No Name>' (0xdc0) has exited with code 0 (0x0).
| > |
| > | I tried to get the thread number by putting this line at the top of my
| > web
| > | methid:
| > | System.Diagnostics.Debug.WriteLine(string.Format("Thread info: {0},
| > |
| >
{1}",System.Threading.Thread.CurrentThread.Name,System.Threading.Thread.Curr
| > entThread.ManagedThreadId));
| > |
| > | But it retuens different thread number. How can I get the thread
number
| > that
| > | IDE's output window message shows?
| > |
| > | Thank you,
| > |
| > | Alan
| > |
| > |
| > |
| > |
| > |
| > |
| >
|
|
|