title: Sharepoint custom workflow activity fails silently; FaultHandler not being called (or failing)
body: <p>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.</p>
  
  <p>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.</p>
  
  <p>At this phase, logging was done with the following code:</p>
  
  <pre><code>SPWeb spWeb = (SPWeb)__Context.Web;
  SPWorkflow.CreateHistoryEvent(spWeb, this.WorkflowInstanceId, 0, spWeb.CurrentUser, new TimeSpan(), "Update", "message here", string.Empty);
  </code></pre>
  
  <p>where spWeb is the workflow context's Sharepoint Web.  Once again, this works in test.</p>
  
  <p>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 <a href="http://www.sharepointsecurity.com/sharepoint/sharepoint-2007-development/fault-handling-in-sharepoint-workflows/" rel="nofollow noreferrer">http://www.sharepointsecurity.com/sharepoint/sharepoint-2007-development/fault-handling-in-sharepoint-workflows/</a> with the same generic "Error Occurred" result and no other logging in the History list.</p>
  
  <p>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?</p>
  
  <p>Thanks in advance!</p>