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!