我知道有时innerException是null
因此以下可能会失败:
repEvent.InnerException = ex.InnerException.Message;
Run Code Online (Sandbox Code Playgroud)
有没有快速的三元方法来检查innerException是否为null?
我正在使用一些类,这些类在抛出时具有相对较深的InnerException树.我想记录并采取最内部的异常,这是具有问题真正原因的异常.
我目前正在使用类似的东西
public static Exception getInnermostException(Exception e) {
while (e.InnerException != null) {
e = e.InnerException;
}
return e;
}
Run Code Online (Sandbox Code Playgroud)
这是处理异常树的正确方法吗?
So I've been struggling to try and get this resolved for a week or so now. When I attempt to run my application on another computer other than my development machine, I get the following error:
Schema specified is not valid. Errors: EntityFramework.RemManagerDBModel.ssdl(2,79): error 0175: The ADO.Net provider with invariant name 'System.Data.SQLite.EF6' is either not registered in the machine or application config file, or could not be loaded. See the inner exception for details.
I attempted to retrieve the inner …