我正在调用一个异步调用另一个方法的方法(使用委托(delegate))..但是它没有按预期工作..抛出这个
Unable to evaluate expression because the code is optimized or a
native frame is on top of the call stack'` exception..
请大家帮忙
下面是我调用的方法
public bool ProcessInvoices(string printGroupId, bool isControlNum)
{
//Create delegate for asynchronous operation
ProcessInvoicesDelegate _processInvoicesDelegate = new ProcessInvoicesDelegate(ProcessInvoicesFromCABSToExstream);
IAsyncResult result = _processInvoicesDelegate.BeginInvoke(printGroupId, isControlNum, null, null);
return true;
}
最佳答案
这只出现在“监视”窗口中,对吧?如果启用了构建属性中的“优化代码”标志,则某些变量实际上不再存在。默认情况下,这对于调试构建是禁用的,对于发布构建是启用的,但可以修改。
关于c# - 如何修复 C# 中的 'Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58797583/