gpt4 book ai didi

c# - DocumentViewer WPF 控件未加载

转载 作者:行者123 更新时间:2023-11-30 16:20:08 26 4
gpt4 key购买 nike

似乎 DocumentViewer 控件可能不喜欢 Windows 8。只是将它放在窗体上(所有默认值,没有数据集或任何东西,它甚至还没有完成 InitializeComponent)我得到这个错误:

检测到绑定(bind)失败

The assembly with display name 'PresentationUI.Aero2' failed to load in the 'Load' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'PresentationUI.Aero2, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

如果我摆脱控制,问题就会消失。奇怪的是,设计师对此完全没有任何问题。

我尝试添加对名称中包含 Aero2 的唯一框架程序集的引用,但没有任何作用。并且在谷歌上的任何地方都没有提到这个错误。我正在尝试组装一个 documentpaginator,我不得不使用 pdf 打印机来解决这个问题,但我最终需要一个工作查看器。

最佳答案

我在 wpf 4.5 解决方案中遇到了同样的问题。

我最终做的是:

  1. 创建一个新的空白解决方案
  2. 然后将“旧”解决方案中的现有项目添加到新解决方案中。 (对我来说,我的解决方案中有 5 个项目,因此我必须将它们全部添加)。
  3. 然后我构建并运行了新的解决方案。

这解决了错误,并且在我的任何项目中都没有对 Aero2 的引用。

我不确定为什么会修复它,但我很高兴它做到了。

编辑:

It seems that .suo file is the cause of all this. I've ran into this couple times - making a new project doesn't work, but new solution works - in the end I realized (thanks to a comment below) it's down to the .suo file. After removing it it worked ok.

关于c# - DocumentViewer WPF 控件未加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14649813/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com