WF4 AssignActivity - 多行语句中断设计器

发布于 2024-11-28 17:10:05 字数 1294 浏览 4 评论 0原文

我正在使用 WF4 设计器来构建自定义活动。

每当我尝试将多行语句分配给设计器内的分配活动中的“值”属性并重建项目时,设计器都会因以下错误而中断:“XC1020:XAML MSBuild 任务中发生生成错误:''xml: space' 是重复的属性名称。”

例如,以下语句(无换行符)是有效的:

New WorkItem() With {.AssociatedProgrammeId = associatedProgrammeId, .AssociatedQuestionnaireId = associatedQuestionnaireId, .AssociatedQuestionnaireInstanceId = associatedQuestionnaireInstanceId, .DelayUntil = delayUntil}

但此语句破坏了设计器(在构建项目后):

New WorkItem() With
{
    .AssociatedProgrammeId = associatedProgrammeId,
    .AssociatedQuestionnaireId = associatedQuestionnaireId,
    .AssociatedQuestionnaireInstanceId = associatedQuestionnaireInstanceId,
    .DelayUntil = delayUntil
}

第二个语句生成以下 XAML:

<Assign.Value>
    <InArgument x:TypeArguments="local:WorkItem" xml:space="preserve">[New WorkItem() With
{
    .AssociatedProgrammeId = associatedProgrammeId,
    .AssociatedQuestionnaireId = associatedQuestionnaireId,
    .AssociatedQuestionnaireInstanceId = associatedQuestionnaireInstanceId,
    .DelayUntil = delayUntil
}]</InArgument>

删除 xml:space="preserve" 并重建修复了设计器,以便可以编辑活动,但会删除 InArgument 中的换行符。

我假设我应该能够向该活动的参数添加多重语句。我想我可能会被磨损,这是设计师的限制?

如果没有,有人可以帮我弄清楚如何让 Visual Studio 表现出来吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

荒路情人 2024-12-05 17:10:05

重新审视了这个问题。这个问题似乎已经自行解决了。我还没有更新 Visual Studio 或类似的东西,所以如果有人有类似的问题,我建议尝试重新启动 Visual Studio。

更新
在完全重建我的项目后,问题再次出现,因此我已将问题作为错误提交到 Microsoft Connect 上。

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文