By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,635 Members | 1,707 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,635 IT Pros & Developers. It's quick & easy.

Needed help on 'System.StackOverflowException'

P: n/a
Dear all,

I'm new to C# WebServices. I compile the WebService project it return no
errors "Build: 1 succeeded, 0 failed, 0 skipped".

Basically I have 2 WebMethod, when I try to invoke the first method it is
working fine. Then when I try to invoke the second method it return me an
error, Just In-Time Debugging, with error message
"An exception 'System.StackOverflowException' has occurred in WebServices"

What is the problem ? How to resolve it ?

Thanks in advance.
Nov 23 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
it's hard to tell, without looking a the code, but most of the time
StackOverflowException thrown when there's infinite loop in a funtcion ,
a classic exmaple

public string SayHello()
{
return SayHello();
}

Regards
Erymuzuan Mustapa

Mae Lim wrote:
Dear all,

I'm new to C# WebServices. I compile the WebService project it return no
errors "Build: 1 succeeded, 0 failed, 0 skipped".

Basically I have 2 WebMethod, when I try to invoke the first method it is
working fine. Then when I try to invoke the second method it return me an
error, Just In-Time Debugging, with error message
"An exception 'System.StackOverflowException' has occurred in WebServices"

What is the problem ? How to resolve it ?

Thanks in advance.

Nov 23 '05 #2

P: n/a
Hi erymuzuan,

How do I trace where is the StackOverflowException is thrown in the
WebServices ? Is there any tools that I can use ?
"erymuzuan" wrote:
it's hard to tell, without looking a the code, but most of the time
StackOverflowException thrown when there's infinite loop in a funtcion ,
a classic exmaple

public string SayHello()
{
return SayHello();
}

Regards
Erymuzuan Mustapa

Mae Lim wrote:
Dear all,

I'm new to C# WebServices. I compile the WebService project it return no
errors "Build: 1 succeeded, 0 failed, 0 skipped".

Basically I have 2 WebMethod, when I try to invoke the first method it is
working fine. Then when I try to invoke the second method it return me an
error, Just In-Time Debugging, with error message
"An exception 'System.StackOverflowException' has occurred in WebServices"

What is the problem ? How to resolve it ?

Thanks in advance.

Nov 23 '05 #3

P: n/a
If you are the developer of the Web service, i.e. if you have access to
the code then you can always add a try/catch block around the lines in
your WebMethod:

[WebMethod]
public void MyMethod()
{
try
{
}
catch( Exception ex )
{
System.Diagnostics.Debug.WriteLine( ex.ToString() );
}
}

and run DebugView from www.sysinternals.com to read the error message.

If it's an ASP.NET web service with simple parameter types and you can
convince the owner to allow you to see the full exception messages by
setting
<customErrors
mode="Off">
in the service's web.config file, then you may want to try invoking the
web service from the browser by navigating to the service's URL and
entering the parameter values on the test page.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: Mae Lim [mailto:Ma****@discussions.microsoft.com]
Posted At: Sunday, January 02, 2005 6:45 PM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: Needed help on 'System.StackOverflowException'
Subject: Re: Needed help on 'System.StackOverflowException'

Hi erymuzuan,

How do I trace where is the StackOverflowException is thrown in the
WebServices ? Is there any tools that I can use ?
"erymuzuan" wrote:
it's hard to tell, without looking a the code, but most of the time
StackOverflowException thrown when there's infinite loop in a funtcion ,
a classic exmaple

public string SayHello()
{
return SayHello();
}

Regards
Erymuzuan Mustapa

Mae Lim wrote:
Dear all,

I'm new to C# WebServices. I compile the WebService project it
return no errors "Build: 1 succeeded, 0 failed, 0 skipped".

Basically I have 2 WebMethod, when I try to invoke the first
method it
is working fine. Then when I try to invoke the second method it
return me
an error, Just In-Time Debugging, with error message
"An exception 'System.StackOverflowException' has occurred in WebServices"
What is the problem ? How to resolve it ?

Thanks in advance.


Nov 23 '05 #4

P: n/a
Hi Christoph,

I already added a try/catch block in the WebMethod. I've downloaded the
tools "DebugView", but how this tool help to trace the StackOverflowException
? When I try to run the "DebugView" it doesn't seem to catch any errors.

Please guide me. Thanks.
"Christoph Schittko [MVP]" wrote:
If you are the developer of the Web service, i.e. if you have access to
the code then you can always add a try/catch block around the lines in
your WebMethod:

[WebMethod]
public void MyMethod()
{
try
{
}
catch( Exception ex )
{
System.Diagnostics.Debug.WriteLine( ex.ToString() );
}
}

and run DebugView from www.sysinternals.com to read the error message.

If it's an ASP.NET web service with simple parameter types and you can
convince the owner to allow you to see the full exception messages by
setting
<customErrors
mode="Off">
in the service's web.config file, then you may want to try invoking the
web service from the browser by navigating to the service's URL and
entering the parameter values on the test page.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko

-----Original Message-----
From: Mae Lim [mailto:Ma****@discussions.microsoft.com]
Posted At: Sunday, January 02, 2005 6:45 PM
Posted To: microsoft.public.dotnet.framework.webservices
Conversation: Needed help on 'System.StackOverflowException'
Subject: Re: Needed help on 'System.StackOverflowException'

Hi erymuzuan,

How do I trace where is the StackOverflowException is thrown in the
WebServices ? Is there any tools that I can use ?
"erymuzuan" wrote:
it's hard to tell, without looking a the code, but most of the time
StackOverflowException thrown when there's infinite loop in a funtcion , a classic exmaple

public string SayHello()
{
return SayHello();
}

Regards
Erymuzuan Mustapa

Mae Lim wrote:
> Dear all,
>
> I'm new to C# WebServices. I compile the WebService project it

return
no
> errors "Build: 1 succeeded, 0 failed, 0 skipped".
>
> Basically I have 2 WebMethod, when I try to invoke the first

method it
is
> working fine. Then when I try to invoke the second method it

return me
an
> error, Just In-Time Debugging, with error message
> "An exception 'System.StackOverflowException' has occurred in

WebServices"
>
> What is the problem ? How to resolve it ?
>
> Thanks in advance.


Nov 23 '05 #5

P: n/a
Hello Mae,
One option is you could see the stack trace of the exception if at all
and determine parts of yr code that are hit before the exception is thrown.
If yr using VS.net but a breakpoint in the begining of the method and step
through you code. To do this you need to use VS.net Debug Processes and attach
to aspnet_wp.exe or w3wp.exe.

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi erymuzuan,

How do I trace where is the StackOverflowException is thrown in the
WebServices ? Is there any tools that I can use ?

"erymuzuan" wrote:
it's hard to tell, without looking a the code, but most of the time
StackOverflowException thrown when there's infinite loop in a
funtcion , a classic exmaple

public string SayHello()
{
return SayHello();
}
Regards
Erymuzuan Mustapa
Mae Lim wrote:
Dear all,

I'm new to C# WebServices. I compile the WebService project it
return no errors "Build: 1 succeeded, 0 failed, 0 skipped".

Basically I have 2 WebMethod, when I try to invoke the first method
it is working fine. Then when I try to invoke the second method it
return me an error, Just In-Time Debugging, with error message "An
exception 'System.StackOverflowException' has occurred in
WebServices"

What is the problem ? How to resolve it ?

Thanks in advance.

Nov 23 '05 #6

P: n/a
Hi Dilip,

I would like to know how do I use the VS.net Debug Processes and attach
to aspnet_wp.exe or w3wp.exe ?
"Dilip Krishnan" wrote:
Hello Mae,
One option is you could see the stack trace of the exception if at all
and determine parts of yr code that are hit before the exception is thrown.
If yr using VS.net but a breakpoint in the begining of the method and step
through you code. To do this you need to use VS.net Debug Processes and attach
to aspnet_wp.exe or w3wp.exe.

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi erymuzuan,

How do I trace where is the StackOverflowException is thrown in the
WebServices ? Is there any tools that I can use ?

"erymuzuan" wrote:
it's hard to tell, without looking a the code, but most of the time
StackOverflowException thrown when there's infinite loop in a
funtcion , a classic exmaple

public string SayHello()
{
return SayHello();
}
Regards
Erymuzuan Mustapa
Mae Lim wrote:

Dear all,

I'm new to C# WebServices. I compile the WebService project it
return no errors "Build: 1 succeeded, 0 failed, 0 skipped".

Basically I have 2 WebMethod, when I try to invoke the first method
it is working fine. Then when I try to invoke the second method it
return me an error, Just In-Time Debugging, with error message "An
exception 'System.StackOverflowException' has occurred in
WebServices"

What is the problem ? How to resolve it ?

Thanks in advance.


Nov 23 '05 #7

P: n/a
Hello Mae,
In visual studio use the menu option Debug->Process... That will give you
a dialog box select aspnet_wp.exe if yr using XP or look for w3wp.exe in
Win2k3

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi Dilip,

I would like to know how do I use the VS.net Debug Processes and
attach to aspnet_wp.exe or w3wp.exe ?

"Dilip Krishnan" wrote:
Hello Mae,
One option is you could see the stack trace of the exception if at
all
and determine parts of yr code that are hit before the exception is
thrown.
If yr using VS.net but a breakpoint in the begining of the method and
step
through you code. To do this you need to use VS.net Debug Processes
and attach
to aspnet_wp.exe or w3wp.exe.
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi erymuzuan,

How do I trace where is the StackOverflowException is thrown in the
WebServices ? Is there any tools that I can use ?

"erymuzuan" wrote:

it's hard to tell, without looking a the code, but most of the time
StackOverflowException thrown when there's infinite loop in a
funtcion , a classic exmaple

public string SayHello()
{
return SayHello();
}
Regards
Erymuzuan Mustapa
Mae Lim wrote:
> Dear all,
>
> I'm new to C# WebServices. I compile the WebService project it
> return no errors "Build: 1 succeeded, 0 failed, 0 skipped".
>
> Basically I have 2 WebMethod, when I try to invoke the first
> method it is working fine. Then when I try to invoke the second
> method it return me an error, Just In-Time Debugging, with error
> message "An exception 'System.StackOverflowException' has occurred
> in WebServices"
>
> What is the problem ? How to resolve it ?
>
> Thanks in advance.
>

Nov 23 '05 #8

P: n/a
Hi Dilip,

I had follow the steps you mentioned, so what is the next step ? After debug
process, how do I know what is the result out of it ?

"Dilip Krishnan" wrote:
Hello Mae,
In visual studio use the menu option Debug->Process... That will give you
a dialog box select aspnet_wp.exe if yr using XP or look for w3wp.exe in
Win2k3

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi Dilip,

I would like to know how do I use the VS.net Debug Processes and
attach to aspnet_wp.exe or w3wp.exe ?

"Dilip Krishnan" wrote:
Hello Mae,
One option is you could see the stack trace of the exception if at
all
and determine parts of yr code that are hit before the exception is
thrown.
If yr using VS.net but a breakpoint in the begining of the method and
step
through you code. To do this you need to use VS.net Debug Processes
and attach
to aspnet_wp.exe or w3wp.exe.
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi erymuzuan,

How do I trace where is the StackOverflowException is thrown in the
WebServices ? Is there any tools that I can use ?

"erymuzuan" wrote:

> it's hard to tell, without looking a the code, but most of the time
> StackOverflowException thrown when there's infinite loop in a
> funtcion , a classic exmaple
>
> public string SayHello()
> {
> return SayHello();
> }
> Regards
> Erymuzuan Mustapa
> Mae Lim wrote:
>> Dear all,
>>
>> I'm new to C# WebServices. I compile the WebService project it
>> return no errors "Build: 1 succeeded, 0 failed, 0 skipped".
>>
>> Basically I have 2 WebMethod, when I try to invoke the first
>> method it is working fine. Then when I try to invoke the second
>> method it return me an error, Just In-Time Debugging, with error
>> message "An exception 'System.StackOverflowException' has occurred
>> in WebServices"
>>
>> What is the problem ? How to resolve it ?
>>
>> Thanks in advance.
>>


Nov 23 '05 #9

P: n/a
Hello Mae,
Put a break point on the web method yr debugging, Invoke the service.
and step through the code... For indepth explanation refer http://msdn.microsoft.com/library/de...pplication.asp

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi Dilip,

I had follow the steps you mentioned, so what is the next step ? After
debug process, how do I know what is the result out of it ?

"Dilip Krishnan" wrote:
Hello Mae,
In visual studio use the menu option Debug->Process... That will give
you
a dialog box select aspnet_wp.exe if yr using XP or look for w3wp.exe
in
Win2k3
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi Dilip,

I would like to know how do I use the VS.net Debug Processes and
attach to aspnet_wp.exe or w3wp.exe ?

"Dilip Krishnan" wrote:

Hello Mae,
One option is you could see the stack trace of the exception if at
all
and determine parts of yr code that are hit before the exception is
thrown.
If yr using VS.net but a breakpoint in the begining of the method
and
step
through you code. To do this you need to use VS.net Debug Processes
and attach
to aspnet_wp.exe or w3wp.exe.
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
> Hi erymuzuan,
>
> How do I trace where is the StackOverflowException is thrown in
> the WebServices ? Is there any tools that I can use ?
>
> "erymuzuan" wrote:
>
>> it's hard to tell, without looking a the code, but most of the
>> time StackOverflowException thrown when there's infinite loop in
>> a funtcion , a classic exmaple
>>
>> public string SayHello()
>> {
>> return SayHello();
>> }
>> Regards
>> Erymuzuan Mustapa
>> Mae Lim wrote:
>>> Dear all,
>>>
>>> I'm new to C# WebServices. I compile the WebService project it
>>> return no errors "Build: 1 succeeded, 0 failed, 0 skipped".
>>>
>>> Basically I have 2 WebMethod, when I try to invoke the first
>>> method it is working fine. Then when I try to invoke the second
>>> method it return me an error, Just In-Time Debugging, with error
>>> message "An exception 'System.StackOverflowException' has
>>> occurred in WebServices"
>>>
>>> What is the problem ? How to resolve it ?
>>>
>>> Thanks in advance.
>>>

Nov 23 '05 #10

P: n/a
One additional note, you will need to set the "Application Protection" for
the virtual directory where your web service lives to "Low (IIS Process)" in
order for your breakpoint to be hit.

Allen

"Dilip Krishnan" wrote:
Hello Mae,
Put a break point on the web method yr debugging, Invoke the service.
and step through the code... For indepth explanation refer http://msdn.microsoft.com/library/de...pplication.asp

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi Dilip,

I had follow the steps you mentioned, so what is the next step ? After
debug process, how do I know what is the result out of it ?

"Dilip Krishnan" wrote:
Hello Mae,
In visual studio use the menu option Debug->Process... That will give
you
a dialog box select aspnet_wp.exe if yr using XP or look for w3wp.exe
in
Win2k3
HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com
Hi Dilip,

I would like to know how do I use the VS.net Debug Processes and
attach to aspnet_wp.exe or w3wp.exe ?

"Dilip Krishnan" wrote:

> Hello Mae,
> One option is you could see the stack trace of the exception if at
> all
> and determine parts of yr code that are hit before the exception is
> thrown.
> If yr using VS.net but a breakpoint in the begining of the method
> and
> step
> through you code. To do this you need to use VS.net Debug Processes
> and attach
> to aspnet_wp.exe or w3wp.exe.
> HTH
> Regards,
> Dilip Krishnan
> MCAD, MCSD.net
> dkrishnan at geniant dot com
> http://www.geniant.com
>> Hi erymuzuan,
>>
>> How do I trace where is the StackOverflowException is thrown in
>> the WebServices ? Is there any tools that I can use ?
>>
>> "erymuzuan" wrote:
>>
>>> it's hard to tell, without looking a the code, but most of the
>>> time StackOverflowException thrown when there's infinite loop in
>>> a funtcion , a classic exmaple
>>>
>>> public string SayHello()
>>> {
>>> return SayHello();
>>> }
>>> Regards
>>> Erymuzuan Mustapa
>>> Mae Lim wrote:
>>>> Dear all,
>>>>
>>>> I'm new to C# WebServices. I compile the WebService project it
>>>> return no errors "Build: 1 succeeded, 0 failed, 0 skipped".
>>>>
>>>> Basically I have 2 WebMethod, when I try to invoke the first
>>>> method it is working fine. Then when I try to invoke the second
>>>> method it return me an error, Just In-Time Debugging, with error
>>>> message "An exception 'System.StackOverflowException' has
>>>> occurred in WebServices"
>>>>
>>>> What is the problem ? How to resolve it ?
>>>>
>>>> Thanks in advance.
>>>>


Nov 23 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.