I'm in the process of setting up a Xamarin.Forms app using .NET Standard for the shared library instead of a PCL. I've followed the instructions for doing so laid out in the blog/video on the topic (on msdn)
This is with a brand new Xamarin.Forms app, created using Visual Studio 2017 with a PCL, which was replaced with a .NET Standard library as described in the video.
The UWP app compiles fine, but throws this exception when I try to start it (on the call to Xamarin.Forms.Forms.Init
)
System.IO.FileLoadException: 'Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'
I've tried specifically adding the nuget package for System.Runtime, version 4.1.0 to the UWP project, but that doesn't seem to help. It runs fine in Android, but keeps giving me this exception running the UWP project. Can anyone tell me what might be causing this and how I can fix it?
Answers
there is a very similar error in the build log:
Followed by an extremely long list of places it has checked.
I also found this, which seems like it may be the problem:
There's also this in the build logs right after the above, which is even more perplexing, as it seems to indicate the only thing referencing version 4.0.20.0 of System.Runtime is... version 4.3.0 of System.Runtime???
Does anyone know how I can resolve this conflict?
Any update on this matter? I have almost the same error but on the files: "clrcompression", "clrjit,", "sqlite3," and "ucrtbased"
Hi KatieBrown and Ties,
I have exactly the same exception thrown when I run the UWP application. Did you find a workaround to solve this issue. I tried also installing the version 4.1.0 of System.Runtime.dll but it does not work at all.
Thanks in advance for any help.
Update your Microsoft.NETCore.UniversalWindowsPlatform nuget package to 6.0.5 and this problem should go away @toto_____ @Ties @KatieBrown
@MarkZhukovsky, your suggestion worked for me, solved the problem. Thank you.