包含 WF 活动的 WPF 应用程序项目会生成泛型类型错误
我有一个 WPF 应用程序,其子文件夹包含 WF Activity 和 CodeActivity。
在使用 CodeActivity 的工作流的编译时,我收到此错误:
XML 命名空间“clr-namespace:System.Collections.Generic; assembly=mscorlib”中不存在标签“Dictionary”。第 4 行位置 8。
报告错误的代码部分是由 Visual Studio 内置活动设计器生成的。例如:
<sap:WorkflowViewStateService.ViewState>
<scg3:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">False</x:Boolean>
<av:Point x:Key="ShapeLocation">270,2.5</av:Point>
<av:Size x:Key="ShapeSize">60,75</av:Size>
<av:PointCollection x:Key="ConnectorLocation">300,77.5 300,107.5 300,112.5</av:PointCollection>
</scg3:Dictionary>
我想知道我是否正在尝试一些不允许的事情或者我是否遗漏了一些东西。
预先感谢,
吉安卢卡
I have a WPF Application with a subfolder that contains a WF Activity and a CodeActivity.
At compile-time on the Workflow that uses the CodeActivity, I get this error:
The tag 'Dictionary' does not exist in XML namespace 'clr-namespace:System.Collections.Generic;assembly=mscorlib'. Line 4 Position 8.
The portion of code that reports the error is generated by the Visual studio built-in Activity designer. E.g. this:
<sap:WorkflowViewStateService.ViewState>
<scg3:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">False</x:Boolean>
<av:Point x:Key="ShapeLocation">270,2.5</av:Point>
<av:Size x:Key="ShapeSize">60,75</av:Size>
<av:PointCollection x:Key="ConnectorLocation">300,77.5 300,107.5 300,112.5</av:PointCollection>
</scg3:Dictionary>
I'd like to know if I am trying to something that is not allowed or if I am missing something.
Thanks in advance,
Gianluca
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我今天也遇到了类似的问题;至少有相同的错误消息。对我来说,问题是 .xaml 文件的构建操作设置为 Page。需要将其设置为 XamlAppDef。如果您打开一个普通的工作流控制台应用程序项目,您就会看到这一点。您无法在下拉列表中更改它,您需要编辑 .csproj 文件(再次与普通 VS 工作流控制台项目进行比较)。
I had a similar problem today; at least the same error message. The problem for me was that the build action of the .xaml file was set to Page. It needs to be set to XamlAppDef. If you open a vanilla Workflow console application project, you'll see that. You can't change it in the drop down, you need to edit the .csproj file (again, compare to vanilla VS workflow console project).