While there can be many other reasons for this, recently we came across a situation where a simple workflow assembly designed by us could not be used in a Workflow. If we added the reference to this workflow assembly in the Workflow, it wouldn’t publish. We would receive the following message “An error occured when the workflow was being created. Try to save the worflow again”. Refer to the image below.
Upon further review of the code, it was noticed that the Namespace and Class name was the same.
Upon changing the namespace to something other than TestWorkflow the workflow designer accepted the workflow assembly and published it too.
Just wondering if this were an issue, it should not have allowed us to register the assembly in the first place. It would have been a better indicator of something being wrong with the class declarations.
For anyone else who face the same problem… it might help to check the class name.