Thursday, 8 November 2007

Changing the namespace of a Windows Workflow project

Today i modified the namespace of a workflow project. A little further down the track when it came to hosting the workflow the workflow runtime puked with the following message:

"Cannot initialize 'StateMachineWorkflowActivity' that does not define a valid 'InitialStateName' property."

The state machine workflow had the initial state set but as i has messed about the with the namespace i had a hunch what it was.

If you come across this error simply open up the workflow.xoml file with an XML editor and change the 'StateMachineWorkflowActivity x:Class' attribute to match your newly modified namespace, save and close.

Now when you build it will run fine. Hopefully VS2008 will fix this as i see it as a bug in the IDE. Changing the namespace should change the namespace in the xoml.

No comments: