1

I am using WF4 and am having my types, activities and workflows in the same project and then I am using ActivityXamlServices.Load(path) to load my workflow activity and it throws the following exception:

The type ‘InArgument(local:,,,, of property ‘InputArgs’ could not be resolved

By looking at the solution to this problem at this post, I included assembly name manually in the workflow, and it all works.

Problem: Everytime I make any change in the workflow, it re-writes the xaml and removes the assembly names I manually added.

Question: Is there a way to mandate including assembly names of local types also?

4

1 に答える 1

1

The trick is to use a XamlXmlReaderSettings and specify what should be used as the local assembly reference.

var settings = new XamlXmlReaderSettings()
{
    LocalAssembly = typeof(YourArgumentType).Assembly
};
var reader = new XamlXmlReader(path, settings);
Activity workflow = ActivityXamlServices.Load(reader);
于 2013-01-18T12:42:08.200 に答える