State Machine Workflow Duplicate Resource Error/Failure.

May 21, 2009 at 12:46 AM

I create a state machine workflow with WSPBuilder as follows:

WSPBuilder Project with Workflow ->Add new item -> WSPBuilder, State Machine Workflow with Feature -> Site Scope -> .NET v3.0

The workflow builds until the time that the <workflow>.rules file is generated (at the time of defining a condition, eg for an ifelse branch).

At thise point I get the following error:

"Resource identifier '<namespace>.<class>' has already been used in this assembly"

After extensive trial and error (on multiple boxes/projects) I have discovered that:

  - Project will build if either the <workflow>.rules or <workflow>.layout files are deleted before compilation (but of course the workflow has errors when attempting to run in sharepoint)

  - The issue does not appear to lie in the project file.

  - When building the WSPBuilder project the build command includes "/resource:WorkflowCode\<featurename>.layout <namespace>.<class> /resource"WorkflowCode\<featurename>.rules, <namespace>.<class>". Both the .layout and .rules files are using identical namespace and class. When building a state machine workflow project with a standard sharepoint workflow project (outside of a WSPBuilder template) the command does not include the namespace and class. eg "/resource:WorkflowCode\<featurename>.layout /resource"WorkflowCode\<featurename>.rules" and builds without errors.

By running the csc.exe build command on the command line with the namespace and class omitted I can get the assembly to build.

Sequential workflows build correctly, using /resource"WorkflowCode\<featurename>.rules, <namespace>.<class>".

Have you seen this before? Is there a way we can get these to build?

Appreciate your response and otherwise very helpful tool,

Regards, Paul.

(VS2008 with WSPBuilder 105)


Jul 6, 2009 at 9:32 AM

I would just like to second this. I seem to get a very similar problem.

Nov 24, 2009 at 9:13 AM

I'm getting this error too - any updates?

Jan 7, 2010 at 2:35 PM
Edited Jan 7, 2010 at 3:49 PM

I have just tried to build a state machine workflow as well and I receive the same error. Anyone got any ideas?


I was using the build menu in VS instead of right clicking on the Project Name and choosing WSPBuilder -> Build WSP. This worked and I was then able to deploy the workflow.


I was able to deploy the workflow but it would not deploy to the GAC still getting the same error as above.

Feb 16, 2010 at 6:35 PM

Since it's not possible to debug the workflows from the WSPBuilder project without lots of grief, I just drag the pieces parts from the Extensions For Sharepoint  1.3  project into the WSPBuilder project -- delete the .layouts file since it's a deployment only project at this point  and Bob's Your Uncle.

The .layouts files just positions the activities on the canvas.. it has no use at runtime.




Feb 23, 2010 at 1:31 PM

Targeting 3.5 and adding the following line to the project file fixed this for me -

<Import Project="$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets" />