【发布时间】:2014-09-03 22:04:26
【问题描述】:
我在我的 wpf 应用程序中使用ribbon control。在使用 github 在另一台机器上拉取代码后运行时,我遇到了这个错误:
'Initialization of 'Microsoft.Windows.Controls.Ribbon.RibbonApplicationMenuItem' threw an exception.' Line number '15' and line position '26'.
我最初的想法是我必须手动将功能区控件安装到我的新机器上,但是当我使用 Nuget 管理器检查时,似乎已经安装了功能区控件库。
包括命名空间using Microsoft.Windows.Controls.Ribbon;也没有错误
只有在加载具有功能区控件的窗口时才会引发异常。
编辑: 我清理了解决方案并重新构建。现在我的 Visual Studio 在错误列表中给了我错误:
Error 3 Could not load file or assembly 'Microsoft.Windows.Shell, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. D:\Projects\WPFTut\Ribbons\MainWindow.xaml 12 13 Ribbons
我很高兴我不需要安装功能区控件,因为之前的运行在这台机器上运行良好,尽管自那次提交以来没有任何自动生成的文件发生变化。
【问题讨论】:
标签: c# wpf wpf-controls ribbon