VS 2008: asynchronous delegate is causing native frame exception whenI call new XmlSerializer()

O

Ojas

When I use a C# asynchronous delegate to put a method's execution on a
different thread, I will eventually get a
[System.Threading.ThreadAbortException] = {Unable to evaluate
expression because the code is optimized or a native frame is on top
of the call stack.}

Does anyone have any insight into why this is only happening when I
run the method on an async delegate thread? If I keep everything
single threaded in C#, it works fine.

But as soon as I introduce the async thread, I start getting these
exceptions from different places in my code.
 
M

Morten Wennevik [C# MVP]

Hi Ojas,

Without seeing the code it is hard to give a good answer to your problem.
google/bing the error and see if any of the hits match your scenario. The
error indicates something happens on a thread the debugger does not expect,
like Thread.Abort being called due to an exception thrown outside the thread.
 

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