由于来自WPFToolKit的DatePicker导致的XamlParseException

时间:2010-04-13 04:31:34

标签: c# wpf visual-studio-2008 wpftoolkit xamlparseexception

错误:UnhandledException:System.Windows.Markup.XamlParseException:'/ WPFToolkit; component = DataGrid / Themes / Luna.NormalColor.xaml'值无法分配给对象'System.Windows.ResourceDictionary'的属性'Source'。

Could not load type 'System.Windows.Controls.Primitives.MultiSelector' from assembly 'PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.  Error at object 'System.Windows.ComponentResourceKey' in markup file 'WPFToolkit;component/DataGrid/Themes/Luna.NormalColor.xaml'.  Error at object 'System.Windows.ResourceDictionary'. ---> 

System.Windows.Markup.XamlParseException:  Could not load type 'System.Windows.Controls.Primitives.MultiSelector' from assembly 'PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.  Error at object 'System.Windows.ComponentResourceKey' in markup file 'WPFToolkit;component/DataGrid/Themes/Luna.NormalColor.xaml'. ---> 

System.TypeLoadException: Could not load type 'System.Windows.Controls.Primitives.MultiSelector' from assembly 'PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

我一直收到以下异常。当我从Release文件夹运行应用程序exe时,我收到异常。在正常情况下在Visual Studio中调试应用程序时,我根本没有得到异常。我已经知道异常是因为我正在使用的DatePicker控件 - 好像我删除了控件(再次构建并运行release exe),异常就消失了。

我怎么能弄清楚这里出了什么问题?

datepicker看起来好多了,但是为了努力这看起来可能是修复我可能倾向于切换一个文本框,我在按下提交按钮时验证! Dissapointing ...

1 个答案:

答案 0 :(得分:0)

问题是由于测试机器具有.Net Framework 3.5而不是3.5 SP1。升级到3.5 SP1解决了这个问题。