aspnet.exe crash

  • Thread starter Thread starter z. f.
  • Start date Start date
Z

z. f.

if an aspx page call server.execute on itself, the aspnet.exe process
crashes.
i know this should not happend or is not a good programming habbit (i found
it out by mistake), but i also know that running a method on a managed code
class like asp dot net server utility object should not cause the aspnet.exe
process to crash.
what about exceptions etc... ?
 
I'm not sure i understand what you are saying? Why would you call execute in
this way since you may introduce a stack overflow. An application cannot
protect against this.

To call COM components, you must set aspcompat = true which is responsible
for taking care of some plumbing issues in order to get the call to work.
 
A managed exception is your code is not going to crash the asp net
worker process. However, consider the following code in a web form:

private void Page_Load(object sender, EventArgs e)
{
Server.Transfer(Request.Path);
}

The above code attempts to transfer the request to itself from now
until infinity, which we agree is a bad thing. Each transfer is going
to chew up more and more resources on the server until something has
to give. You can make an argument that the framework should detect the
problem and throw an exceptime, but to me it seems like a special
case.

Just doing a transfer to the same page doesn't in and of itself cause
a crash, as the following example executes just fine. If you are
getting a crash on the first Server.Transfer method call perhaps there
is another problem.

private void Page_Load(object sender, System.EventArgs e)
{
int count = 0;
object o = Context.Items[COUNTKEY];

if(o != null)
{
count = Convert.ToInt32(o) + 1;
}

if(count < 10)
{
Context.Items[COUNTKEY] = count;
Server.Transfer(Request.Path);
}
else
{
Response.Write("Done " + count.ToString());
}
}
protected const string COUNTKEY = "count";
 
Back
Top