在 WPF 项目中包含 UWP 项目会引发运行时错误 [英] Including UWP project in WPF project raises runtime errors

查看:66
本文介绍了在 WPF 项目中包含 UWP 项目会引发运行时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从事的项目需要在 WPF 窗口内显示来自 UWP 库的 UWP 控件.这是我的工作所基于的文档页面(检查添加自定义 UWP 控件的部分):https://docs.microsoft.com/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): https://docs.microsoft.com/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 项目会引发运行时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆