Unhandled Exception after Remointg...

  • Thread starter Salvador Ponticelli
  • Start date
S

Salvador Ponticelli

In an ASP.NET Application I have an instance of a remoting object. After the
instance was created, I saved it in a Session variable. When I try to use
this instance with the Remoting Service down, it throw an exception wich it
is catched. After this exception is catched, another exception is throwed
outside my try-catch blocks. I can´t catch this new exception. This happen
only in first and second execution after application compile. After second
execution, (no mather how many times I execute the application) only one
exception is throwed.

When remoting object instance isn't in Session variable, only one exception
is throwed in all runs, no mather if it is the firts or the eleventh run.

Can anyone tell me why 2 exception are throwed in the first and second run
after compiling only if the remoting object instance is stored in Session.

Thanks in advantage

Salvador Ponticelli
 
N

Nicholas Paldino [.NET/C# MVP]

Salvador,

Once the exception happens, are you trying to access the object over
again? If you are, then this is a bad idea (assuming the exception is not
remoted from the other app domain, but rather, an issue with connecting to
the app domain). Basically, you should drop the proxy if this occurs, as it
is probably in an inconsistent state at that point.

The way executions work, it bubbles up the call stack, and can not
continue executing code, so the exception that is thrown after that (before
the next property access/method call on the object) would be from your code
(if you have caught the exception). In other words, only one exception can
be thrown per method call/property access.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top