I am using the WF4 designer to build a custom activity.
Whenever I try to assign a multi line statement to the 'Value' property in an Assign activity within the designer and rebuild my project the designer is broken with the error: "XC1020: Build error occurred in the XAML MSBuild task: ''xml:space' is a duplicate attribute name."
For example the following statement (no line breaks) is valid:
New WorkItem() With {.AssociatedProgrammeId = associatedProgrammeId, .AssociatedQuestionnaireId = associatedQuestionnaireId, .AssociatedQuestionnaireInstanceId = associatedQuestionnaireInstanceId, .DelayUntil = delayUntil}
but this statement breaks the designer (after building the project):
New WorkItem() With
{
.AssociatedProgrammeId = associatedProgrammeId,
.AssociatedQuestionnaireId = associatedQuestionnaireId,
.AssociatedQuestionnaireInstanceId = associatedQuestionnaireInstanceId,
.DelayUntil = delayUntil
}
The 2nd statement produces the following XAML:
<Assign.Value>
<InArgument x:TypeArguments="local:WorkItem" xml:space="preserve">[New WorkItem() With
{
.AssociatedProgrammeId = associatedProgrammeId,
.AssociatedQuestionnaireId = associatedQuestionnaireId,
.AssociatedQuestionnaireInstanceId = associatedQuestionnaireInstanceId,
.DelayUntil = delayUntil
}]</InArgument>
Removing xml:space="preserve" and rebuilding fixes the designer so the the Activity can be edited but removes the line breaks from the InArgument.
I am assuming that I should be able to add a multine statement to the argument for the activity. I guess I could be worng and this is a limitation of the designer?
If not could someone please help me figure out how I can make Visual Studio behave?