Unable to evaluate expression because the code is optimized or a native frame is on top of the call

  • Thread starter Thread starter Les Caudle
  • Start date Start date
L

Les Caudle

I'm getting this exception in some 3rd party code.

Unable to evaluate expression because the code is optimized or a native frame is
on top of the call stack.

I'd like to be able to just ignore the exception as:

try {
// run 3rd party code
} catch {

}

But I still get an exception in a try for the enclosing method, even though I
can see that fhe code able does enter the catch (so it should ingore the
exception at that point).

What's the correct way to catch and ignore some strange error like this. I've
never gotten an error of this type before, that behaves so strangely.
 
Les said:
I'm getting this exception in some 3rd party code.

Unable to evaluate expression because the code is optimized or a native frame is
on top of the call stack.

I'd like to be able to just ignore the exception as:

try {
// run 3rd party code
} catch {

}

But I still get an exception in a try for the enclosing method, even though I
can see that fhe code able does enter the catch (so it should ingore the
exception at that point).

What's the correct way to catch and ignore some strange error like this. I've
never gotten an error of this type before, that behaves so strangely.

That error comes from the inability to read the call stack, and is
probably caused by the code that is catching an exception from unmanaged
code. You should look at the inner exception to find the original cause.

You might not be able to prevent the error from showing, as you have a
debugger installed on your computer. A regular user doesn't have a
debugger, so the exception goes to the calling code. If you close the
message, the exception should bubble up to the calling code just as if
you didn't have a debugger installed.
 
Back
Top