XAML 页面在 Visual Studio 2008 上显示异常消息

发布于 2024-12-03 07:50:09 字数 705 浏览 7 评论 0原文

我正在开发一个 WPF 应用程序,该应用程序已经运行良好一段时间了。最近,尽管应用程序运行良好,但 XAML 用户控件在 Visual Studio 2008 上无法正确显示。它显示一长串异常消息。为了方便起见,下面列出了一些消息。

调用目标已引发异常。

调用目标已引发异常。

'/Microsoft.Windows.Design.Developer;组件/主题/GridAdorners.xaml' 值无法分配给对象的属性“Source” '系统.Windows.资源字典'。无法创建实例 程序集中定义的“GenericTheme” 'Microsoft.Windows.Design.Interaction,版本=3.5.0.0, 文化=中立,PublicKeyToken=b03f5f7f11d50a3a'。例外情况是 由调用的目标抛出。对象错误 “ResourceDictionary_4”。

无法创建程序集中定义的“GenericTheme”实例 'Microsoft.Windows.Design.Interaction,版本=3.5.0.0, 文化=中立,PublicKeyToken=b03f5f7f11d50a3a'。例外情况是 由调用目标抛出。

补充一下,最近我已从 Expression Blend 2 升级到 Expression Blend 3。但不确定问题是否相关。

I am working on a WPF App which has been working fine for some time. Recently, the XAML user controls do not show up properly on Visual Studio 2008 though the Application runs fine. It shows a long list of Exception messages. For convenience, some of the messages are listed below.

Exception has been thrown by the target of an invocation.

Exception has been thrown by the target of an invocation.

'/Microsoft.Windows.Design.Developer;component/themes/GridAdorners.xaml'
value cannot be assigned to property 'Source' of object
'System.Windows.ResourceDictionary'. Cannot create instance of
'GenericTheme' defined in assembly
'Microsoft.Windows.Design.Interaction, Version=3.5.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Exception has been
thrown by the target of an invocation. Error at object
'ResourceDictionary_4'.

Cannot create instance of 'GenericTheme' defined in assembly
'Microsoft.Windows.Design.Interaction, Version=3.5.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Exception has been
thrown by the target of an invocation.

Just to add, recently I have upgraded into Expression Blend 3 from Expression Blend 2. Not sure if the issue is related though.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如果没有 2024-12-10 07:50:09

执行以下操作:

  1. 在 Visual Studio 中打开您的解决方案。
  2. 在 Blend 中打开相同的解决方案,但尚未打开任何文件。
  3. 将 VS 调试器附加到 Blend 并在所有托管运行时异常上中断。
  4. 打开问题文件。您现在应该可以看到哪些代码引发了哪些异常。

买者自负:我一直在 VS2010/Blend 4 中这样做,但还没有在 VS2008/Blend 3 中尝试过。

Do this:

  1. Open your solution in Visual Studio.
  2. Open the same solution in Blend, but not yet open any files.
  3. Attach the VS debugger to Blend and break on all managed runtime exceptions.
  4. Open the problem file. You should now see what code is throwing which exception.

Caveat emptor: I do this all of the time with VS2010/Blend 4, but haven't tried it with VS2008/Blend 3.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文