【问题标题】:Service stack elmah implementation服务堆栈 elmah 实现
【发布时间】:2013-11-11 11:53:30
【问题描述】:

我们最近更新了 ServiceStack.Logging.Elmah 的版本,过去在旧版本中工作的代码不再工作:

        ServiceExceptionHandler += (request, exception) =>
        {
            var context = HttpContext.Current;
            Elmah.ErrorLog.GetDefault(context).Log(new Error(exception,context));
            return DtoUtils.HandleException(this, request, exception);
        };

它不会在 new Error() 的异常变量上编译。我已经尝试将它们转换为异常,但这只会导致整个代码“无法将运算符'+ ='应用于'ServiceStack.WebHost.Endpoints.HandleServiceExceptionDelegate'和'lambda表达式'类型的操作数的另一个错误。正在努力寻找更新的任何文档,谁能告诉我代码更改是什么?

【问题讨论】:

    标签: c# servicestack elmah


    【解决方案1】:

    ServiceExceptionHandler 的签名现在是:

    ServiceExceptionHandler += (httpReq, request, exception) => { .. }
    

    我建议加入ServiceStack G+ Community,以便在发布期间收到任何重大更改的通知。

    【讨论】:

      猜你喜欢
      • 2013-01-25
      • 1970-01-01
      • 2010-11-27
      • 2013-12-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-07
      相关资源
      最近更新 更多