4
votes

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: 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)\r\n"

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.

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

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?

Extra Info

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

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, Version=4.0.14.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

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

1
I have exactly the same problem with exact same error message. if you find a solution, please share.Emil
@batmaci just a couple of questions out of interest; When did this error start occurring? and do you use the Xamarin.Forms plugin Rg.Popup?User1
yes, I use Rg.popup, It started happening to be honest, i dont know because I have been working on Android recently but updating nugets for entire solution. Just today I looked into UWP project so I found this error. why you think it is Rg.popup?Emil
do you have project.json.lock file in your uwp project? hidden probably.Emil
@batmaci do you use a pre release version of Rg.Popup? and what version do you use. This error only happens on my branch which I was upgrading rg.popup but at this stage its just a hunch.User1

1 Answers

4
votes

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

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

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, Version=4.0.14.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

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

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