将Windows Phone 7.0升级到Mango后出现XamlParseException

时间:2013-05-10 15:20:55

标签: windows-phone-7

我刚刚将一个旧项目从WP7.0升级到WP7.1(MANGO),现在,在启动应用程序之后,我在主要的App.cs类中,在InitializeComponent方法上得到了这个错误:

在'DoubleAnimation'类型中找不到属性'IsOptimized'。 [线:14位置:37]

我不知道如何解决这个问题,因为“App”InitializeComponent方法似乎是自动生成的

在第14行中,我只是引用了这样的资源字典:

<ResourceDictionary x:Key="keyname">
      <ResourceDictionary.MergedDictionaries>
          <ResourceDictionary Source="Resources/AppStyles.xaml"/>
      </ResourceDictionary.MergedDictionaries>
 </ResourceDictionary>

堆栈跟踪根本不是很有用:

at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at WP7App.App.InitializeComponent()
   at WP7App.App..ctor()
   at System.Reflection.RuntimeConstructorInfo.InternalInvoke(RuntimeConstructorInfo rtci, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
   at System.Reflection.RuntimeConstructorInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)
   at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
   at MS.Internal.TypeProxy.<>c__DisplayClass30.<GetCreateObjectDelegate>b__2a()
   at MS.Internal.TypeProxy.CreateInstance(UInt32 customTypeId)
   at MS.Internal.FrameworkCallbacks.CreateKnownObject(IntPtr nativeRootPeer, UInt32 customTypeId, String initializationString, IntPtr& nativePeer, UInt32 isCreatedByParser)
   at MS.Internal.FrameworkCallbacks.CreateUnknownObject(String assemblyName, String typeName, IntPtr nativeRootPeer, String initializationString, UInt32& customTypeId, UInt32& coreTypeId, UInt32& typeFlags, IntPtr& nativePeer)

1 个答案:

答案 0 :(得分:0)

我注意到resourcedictionary引用了一个样式的xaml文件,其中包含“isoptimized”键:

<DoubleAnimation Duration="0" To="0.4" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="image1" d:IsOptimized="True"/>

删除密钥修复了问题