在 WPF 项目中包含 UWP 项目会引发运行时错误

编程入门 行业动态 更新时间:2024-10-25 08:24:23
本文介绍了在 WPF 项目中包含 UWP 项目会引发运行时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我从事的项目需要在 WPF 窗口内显示来自 UWP 库的 UWP 控件.这是我的工作所基于的文档页面(检查添加自定义 UWP 控件的部分):docs.microsoft/en-us/windows/communitytoolkit/controls/wpf-winforms/windowsxamlhost#add-a-custom-uwp-control

Project I work on need to show UWP control from UWP library inside of WPF window. Here is the document page on which I had based my work (check section for adding custom UWP control): docs.microsoft/en-us/windows/communitytoolkit/controls/wpf-winforms/windowsxamlhost#add-a-custom-uwp-control

设置了 WPF 窗口,它在运行时显示标准的 UWP 控件(如按钮)就好了.但是,当我包含 UWP 项目时,WPF 窗口在开始时(在 EF 的上下文初始化时)抛出异常.

Had setup WPF window and it shows standard UWP controls (like button) at the runtime just fine. However, when I include UWP project, WPF window throws exception at start (at the moment of context initialization of EF).

Could not load file or assembly 'Windows.Foundation.UniversalApiContract, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

我使用的 Sqlite 版本是 1.0.88.0,EF 是 5.但它与这些库冲突没有任何意义?

Sqlite version I'm using is 1.0.88.0 and EF is 5. But it doesn't make any sense that it clashes with these libraries?

推荐答案

通过将 SQLite 包更新到 1.0.111.0 和 EF 到 6.2.0 版,修复了启动时的问题.

Ffixed an issue on startup by updating SQLite package to 1.0.111.0 and EF to version 6.2.0.

更多推荐

在 WPF 项目中包含 UWP 项目会引发运行时错误

本文发布于:2023-11-10 22:47:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1576673.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:项目   错误   WPF   UWP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!