开发者

WF4 AssignActivity - Multi line statement breaks designer

开发者 https://www.devze.com 2023-03-26 20:18 出处:网络
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

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?


Having revisited the problem. The issue seems to have resolved itself. I have not updated Visual Studio or anything like that so if anyone has similar problems I would suggest trying to restart Visual Studio.

Update The problem reappeared after a full rebuild of my project so I have submitted the problem as a bug on Microsoft Connect.

https://connect.microsoft.com/wf/feedback/details/685092/wf4-assignactivity-multi-line-statement-breaks-designer

0

精彩评论

暂无评论...
验证码 换一张
取 消