Ok. I have been getting this issue once in a while and I need to know how to fix it.
Scenario: I wanted some custom actions performed on my workflow. So created an activity library and a class that inherited the 'CodeActivity' abstract class. I even referenced that library in my workflow project and I was able to drag and drop the activity into the Workflow.
The issue starts when I try to deploy the workflow, Visual Studio 2012 tried to activate the Feature that has the Workflow related xml files and Boom.. This is the error message That I got:
Error occurred in deployment step 'Activate Features': Microsoft.Workflow.Client.ActivityNotFoundException: The activity named 'WorkflowXaml_{GUID1}' from scope '/SharePoint/default/{GUID2}/{GUID3}' was not found.
HTTP headers received from the server - ActivityId: {GUID4}. NodeId: <server name>.
Scope: /SharePoint/default/{GUID2}/{GUID3}. Client ActivityId : {GUID5}
The crazy part is the moment I remove my custom action, the Workflow deploys fine! This happened to me once before and I had to avoid creating a few variables in a specific scope to avoid the same issue. Sounds crazy enough? You Bet!
This is what I have kind of understood, The activities are getting scoped somewhere in the back-end and there is a mismatch or something.
Any suggestions? I badly need the custom activity to get deployed.