Sharepoint 自定义工作流程活动静默失败;未调用FaultHandler(或失败)

发布于 2024-08-09 04:14:21 字数 1019 浏览 2 评论 0原文

我在 Visual Studio 中创建了一个自定义 Sharepoint 工作流活动,该活动在我的测试环境中正常工作和记录,但在生产中失败,并在工作流历史记录列表中显示通用的“发生错误”消息。

为了调试活动(因为针对生产的远程调试是最后的手段),我实现了逐步记录到工作流历史列表以查看它在哪一点失败,结果发现它似乎达到了第一次记录发生之前的错误状态。我一直在使用 try-catch 来捕获异常并将其记录到列表中。历史列表中仍然没有登录。

在此阶段,使用以下代码完成日志记录:

SPWeb spWeb = (SPWeb)__Context.Web;
SPWorkflow.CreateHistoryEvent(spWeb, this.WorkflowInstanceId, 0, spWeb.CurrentUser, new TimeSpan(), "Update", "message here", string.Empty);

其中 spWeb 是工作流上下文的 Sharepoint Web。再次,这在测试中有效。

下一步是使用通用异常类型和 Sharepoint 的 LogToHistoryList 活动进行故障处理。没有骰子。我还尝试了 中概述的故障处理选项http://www.sharepointsecurity.com/sharepoint/sharepoint-2007-development/fault-handling-in-sharepoint-workflows/ 具有相同的通用“发生错误”结果,并且历史记录列表中没有其他日志记录。

那么我的问题是 1)有谁知道什么会导致故障处理程序在生产中不被调用(但如果我以编程方式抛出错误,则在测试中工作)? 2)我还能做些什么来尝试找出活动出错的位置,而无需实际远程调试活动吗?

提前致谢!

I have a custom Sharepoint workflow activity created in Visual Studio that works and logs properly in my test environment but fails in production with a generic "Error Occurred" message in the Workflow History list.

In order to debug the activity (since remote debugging against production is a last resort), I implemented step-by-step logging to the Workflow History List to see at what point it was failing, only to discover that it seems to be reaching an error state before the first logging occurs. I had been using a try-catch to capture the exception and log it to the list as well. Still no logging in the history list.

At this phase, logging was done with the following code:

SPWeb spWeb = (SPWeb)__Context.Web;
SPWorkflow.CreateHistoryEvent(spWeb, this.WorkflowInstanceId, 0, spWeb.CurrentUser, new TimeSpan(), "Update", "message here", string.Empty);

where spWeb is the workflow context's Sharepoint Web. Once again, this works in test.

The next step was to use fault handling with a generic Exception type and Sharepoint's LogToHistoryList activity. No dice. I also tried the fault handling option outlined at http://www.sharepointsecurity.com/sharepoint/sharepoint-2007-development/fault-handling-in-sharepoint-workflows/ with the same generic "Error Occurred" result and no other logging in the History list.

My questions, then, are
1) Does anyone know what would cause the fault handler not to be called in production (yet work in test if I programmatically throw an error)?
2) Is there anything else I can do to try and figure out where the activity is erroring out without actually remote debugging the activity?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

许一世地老天荒 2024-08-16 04:14:22

事实证明,日志记录已关闭,这在某种程度上阻止了故障处理程序记录到事件历史表(或者至少,重新打开日志记录似乎神奇地解决了该问题)。事实证明,生产服务器上没有安装.NET 3.5框架。

It turns out that logging was turned off and this was somehow preventing the fault handler from logging to the event history table (or at least, it seems that turning logging back on magically fixed the issue). It also turned out that the production server did not have .NET 3.5 framework installed on it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文