UWP 应用程序:无法加载文件或程序集“System.Runtime.WindowsRuntime,版本 = 4.0.14.0 [英] UWP application: Could not load file or assembly 'System.Runtime.WindowsRuntime, Version=4.0.14.0

查看:30
本文介绍了UWP 应用程序:无法加载文件或程序集“System.Runtime.WindowsRuntime,版本 = 4.0.14.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 .Net Standard 1.4 构建的 UWP 应用程序,使用 Xamarin 我最近升级了几个我的 nuget 插件和我的 UWP项目已经开始给我以下错误:

I have a UWP application built using .Net Standard 1.4 using Xamarin I have recently upgraded a couple of my nuget plugins and my UWP project has started giving me the following error:

"System.IO.FileLoadException: 无法加载文件或程序集'System.Runtime.WindowsRuntime,版本=4.0.14.0,文化=中性,PublicKeyToken=b77a5c561934e089'.定位的程序集的清单定义与程序集引用不匹配.(例外来自H结果:0x80131040) "

"System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.WindowsRuntime, Version=4.0.14.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) "

现在通常这很简单,您只需添加对该 .dll 的引用.所以我在 here 中找到了 nuget 包并将其添加到我的 UWP 项目中,然后构建.

Now usually this is quite straight forward, you just add a reference to that .dll. So I find the nuget package here and add it to my UWP project and build.

现在最初在 nuget 包页面上我看不到版本 4.0.14 但我还是安装了最新的 (4.3.0).

Now initially on the nuget package page I cant see a Version 4.0.14 but I install the latest (4.3.0) anyway.

但我仍然遇到同样的错误,当我检查 bin 文件夹中该库的版本时,它报告了 V4.0.12 那么我从哪里获得 V4.0.12.0.14 这个库来自?

But I still get the same error and when I check the bin folder for the version of that library it reports V4.0.12 so where do I get the V4.0.14 of this library from?

额外信息

我在互联网上唯一提到的这个版本的 dll 是 这里

The only mention of this version of the dll I can find on the internet is here

更新仅作为发布的一部分Microsoft.NETCore.UniversalWindowsPlatform 并且您必须以秋季为目标我上面列出的 API 的 Creator's Update 或更高版本.那得到你下面的程序集版本(4.0.3.0是最新的独立):

The update was only was published as part of Microsoft.NETCore.UniversalWindowsPlatform and you have to target Fall Creator's Update or higher for the APIs I have listed above. That gets you the following version of the assembly (4.0.3.0 is the latest standalone):

System.Runtime.WindowsRuntime,版本=4.0.14.0,文化=中性,PublicKeyToken=b77a5c561934e089

System.Runtime.WindowsRuntime, Version=4.0.14.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

所以从头开始 .NET 4.6.1 和 .NET Core 2.0-仅通用 Windows平台 10.0.16299 目前.

So scratch .NET 4.6.1 and .NET Core 2.0- only Universal Windows Platform 10.0.16299 for now.

推荐答案

所以这个版本的库没有作为一个独立的包发布.

So this version of the library has not been released as an independent package.

获得此库的唯一方法是将目标版本和最小版本置于 Fall Creators Update 中,如前所述 这里

The only way you can get this library is to put your Target Version and Min Version to Fall Creators Update as mentioned here

更新仅作为发布的一部分Microsoft.NETCore.UniversalWindowsPlatform 并且您必须以秋季为目标我上面列出的 API 的 Creator's Update 或更高版本.那得到你下面的程序集版本(4.0.3.0是最新的独立):

The update was only was published as part of Microsoft.NETCore.UniversalWindowsPlatform and you have to target Fall Creator's Update or higher for the APIs I have listed above. That gets you the following version of the assembly (4.0.3.0 is the latest standalone):

System.Runtime.WindowsRuntime,版本=4.0.14.0,文化=中性,PublicKeyToken=b77a5c561934e089

System.Runtime.WindowsRuntime, Version=4.0.14.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

这是由更新插件引起的(就我而言)Rg.Popup 到版本 1.1.3.73-pre 我猜是因为它们使用了早期版本的 Windows 中不可用的部分 API.我也将此作为针对 Rg.Popup 插件的错误报告提交这里

This is caused (in my case) by updating the plugin Rg.Popup to version 1.1.3.73-pre I'm guessing because they use part of the API that isn't available in an earlier build of windows. I have also filed this as a bug report against the Rg.Popup plugin here

我很确定微软会将该版本作为单独的包发布

I'm pretty sure it's down to microsoft to release that version as a seperate package

澄清 - 将目标版本和最小版本从 Windows 10 Build 10240 更改为秋季创作者更新为我解决了这个问题

To clarify - changing the Target version and min version from Windows 10 Build 10240 to fall creators update fixed the issue for me

这篇关于UWP 应用程序:无法加载文件或程序集“System.Runtime.WindowsRuntime,版本 = 4.0.14.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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