无法解析符号'Point','Size','PointCollection'

时间:2011-12-05 11:53:50

标签: wcf xaml workflow-foundation resharper-6.0

ReSharper 6.1(与Visual Studio本身相似)告诉我WCF Workflow XAML文件中存在错误。

  • 无法解析符号'Point'
  • 无法解析符号'尺寸'
  • 无法解析符号'PointCollection'

虽然它没有任何问题编译并且似乎有效,但我想跟踪错误的原因。 StyleCop显然知道(或认为它知道)Visual Studio没有的东西。

这是给我错误的代码示例:

            <sap:WorkflowViewStateService.ViewState>
              <scg3:Dictionary x:TypeArguments="x:String, x:Object">
                <av:Point x:Key="ShapeLocation">179,251</av:Point>
                <av:Size x:Key="ShapeSize">242,58</av:Size>
                <av:PointCollection x:Key="ConnectorLocation">300,309 300,339 270,339 270,441 300,441</av:PointCollection>
              </scg3:Dictionary>
            </sap:WorkflowViewStateService.ViewState>

这些是命名空间声明:

<Activity
    mc:Ignorable="sap"
    x:Class="Hydra.Sales.Workflows.CreateCustomer"
    xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
    xmlns:av="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:hcid="clrnamespace:Hydra.Common.Infrastructure.DataContracts;assembly=Hydra.Common.Infrastructure"
    xmlns:local="clr-namespace:Hydra.Sales.Activities.Associations"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:mv="clrnamespace:Microsoft.VisualBasic;assembly=System"
    xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
    xmlns:s="clr-namespace:System;assembly=mscorlib"
    xmlns:s1="clr-namespace:System;assembly=System"
    xmlns:s2="clr-namespace:System;assembly=System.Xml"
    xmlns:s3="clr-namespace:System;assembly=System.Core"
    xmlns:s4="clr-namespace:System;assembly=System.ServiceModel"
    xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities"
    xmlns:sad="clr-namespace:System.Activities.Debugger;assembly=System.Activities"
    xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
    xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System"
    xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel"
    xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core"
    xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=mscorlib"
    xmlns:sd="clr-namespace:System.Data;assembly=System.Data"
    mlns:sl="clr-namespace:System.Linq;assembly=System.Core"
    xmlns:st="clr-namespace:System.Text;assembly=mscorlib"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

该项目引用了(其中包括):

  • System System.Activities
  • System.Code
  • System.Xaml
  • System.Xml

添加对WindowsBase的引用会将错误列表减少到Cannot resolve symbol 'PointCollection',但我不相信这是正确的解决方案。

1 个答案:

答案 0 :(得分:4)

WorkflowViewStateService.ViewState类型是来自System.Activities.Presentation的设计时工件。它在运行时对工作流程没有影响。事实上,我们有一个示例,向您展示如何删除它。您可以放心地忽略这些Resharper错误。

Removing the View State the Designer Adds to an XAML File