Troubleshooting SharePoint .NET Workflows


Table of Contents

Tips

Can't see workflow to add to a SharePoint List

If you are on the Workflow Settings page of a SharePoint List and you click Add and don't see your new workflow. Ensure these steps:

  • You've deployed the workflow to your farm via a WSP package. This must include:
    • the dll with the workflow class inside it
    • a feature scoped at Site Collection level (Site)
    • a elements file within the feature with a <Workflow> declaration to the workflow
  • Ensure the Site Collection feature is activated within your Site Collection

"Failed on Start (retrying)"

If you can add the Workflow to your SharePoint List, but when you try and kick off the workflow you get this error in the Workflow status column. Try this:

  • Check your ULS logs and search within them for the words "Workflow Infrastructure"...then see the next section for how to resolve them.

Example errors

Load Workflow Assembly: System.IO.FileNotFoundException: Could not load file or assembly

This occurs when the reference to your assembly in the <Workflow> element in your elements manifest is incorrect OR that the assembly is not in the GAC. This could be because the WSP deployment failed or that the WSP doesn't include the DLL with the deployment.

06/22/2007 14:32:57.79  w3wp.exe (0x0854)                        0x0680 Windows SharePoint Services    Workflow Infrastructure        75yn Unexpected Load Workflow Assembly: System.IO.FileNotFoundException: Could not load file or assembly 'WFmain, Version=3.0.0.0, Culture=neutral, PublicKeyToken=e880d8290d3a3c3b' or one of its dependencies. The system cannot find the file specified.  File name: 'WFmain, Version=3.0.0.0, Culture=neutral, PublicKeyToken=e880d8290d3a3c3b'     at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)     at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)     at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark... 

RunWorkflow: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation

When you see the "RunWorkflow" in the logs, it means you've actually got the workflow kicking off...but when it starts to run it is falling over. In this case...it is because the workflow is dependent on another assembly. Reading through the Stack Trace you can see that it is looking for the 'Microsoft.Practices.Unity.Configuration' dll's.

07/16/2009 17:54:02.34 	w3wp.exe (0x0FE4)                       	0x0C9C	Windows SharePoint Services   	Workflow Infrastructure       	936l	High    	Engine RunWorkflow: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'PerformanceAppraisal.SharePoint.Workflow.ServiceLocator' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Practices.Unity.Configuration, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.  File name: 'Microsoft.Practices.Unity.Configuration, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'     at PerformanceAppraisal.SharePoint.Workflow.ServiceLocator..cctor()         --- End of inner exception stack trace ---     at PerformanceAppraisal.SharePoint....	 
07/16/2009 17:54:02.34*	w3wp.exe (0x0FE4)                       	0x0C9C	Windows SharePoint Services   	Workflow Infrastructure       	936l	High    	...Workflow.ServiceLocator.RegisterType[Interface,Type]()     at PerformanceAppraisal.SharePoint.Workflow.PerformanceAppraisalWorkflow..ctor()     --- End of inner exception stack trace ---     at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)     at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)     at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)     at System.Activator.CreateInstance(Type type, Boolean nonPublic)     at System.Workflow.Runtime.Hosting.DefaultWorkflowLoaderService.CreateInstance(Type workflowType)     at System.Workflow.Runtime.WorkflowDefinitionDispenser.LoadR...	 
07/16/2009 17:54:02.34*	w3wp.exe (0x0FE4)                       	0x0C9C	Windows SharePoint Services   	Workflow Infrastructure       	936l	High    	...ootActivity(Type workflowType, Boolean createDefinition, Boolean initForRuntime)     at System.Workflow.Runtime.WorkflowDefinitionDispenser.GetRootActivity(Type workflowType, Boolean createNew, Boolean initForRuntime)     at System.Workflow.Runtime.WorkflowRuntime.InitializeExecutor(Guid instanceId, CreationContext context, WorkflowExecutor executor, WorkflowInstance workflowInstance)     at System.Workflow.Runtime.WorkflowRuntime.Load(Guid key, CreationContext context, WorkflowInstance workflowInstance)     at System.Workflow.Runtime.WorkflowRuntime.GetWorkflowExecutor(Guid instanceId, CreationContext context)     at System.Workflow.Runtime.WorkflowRuntime.InternalCreateWorkflow(CreationContext context, Guid instanceId)     at System.Workflow.Runtime.WorkflowRuntime.CreateWorkflow(Type wo...	 
07/16/2009 17:54:02.34*	w3wp.exe (0x0FE4)                       	0x0C9C	Windows SharePoint Services   	Workflow Infrastructure       	936l	High    	...rkflowType, Dictionary`2 namedArgumentValues, Guid instanceId)     at Microsoft.SharePoint.Workflow.SPWinOeHostServices.Send(SPWinOeWorkflow winoeworkflow, SPWorkflowEvent e)     at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(Guid trackingId, SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut)	 
07/16/2009 17:54:02.53 	w3wp.exe (0x0FE4)                       	0x0C9C	Windows SharePoint Services   	General                       	75fe	High    	Failed to determine definition for Feature with ID 'd60b36f1-e8c5-40ed-884b-68f73a2709ce'.  Skipping this feature for element querying consideration.	 

External References

Workflow "Failed on Start (retrying) by Code Eater"

Labels

workflow workflow Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.



Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.