System.Core v4.0.0.0 exception in Xamarin UWP project

1

Currently, I have a Xamarin forms project for Android and iOS application. And the application works perfectly in both Android and iOS. I wanted to provide the support in Windows as well. So I followed the below link to add the UWP project to my solution.

https://developer.xamarin.com/guides/xamarin-forms/platform-features/windows/installation/universal/

After adding the new project for UWP the solution is build with UWP as startup project. But, when i try to run the application in Local Machine. I get the following error.

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

I tried both in VS2015 and VS2017, both provide the same error(VS2015 provides additional two errors regarding mscorlib which is not coming in VS2017).

Here is the stack trace for the error.

at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit) at Xamarin.Forms.Internals.Registrar.RegisterAll(Type[] attrTypes) at Xamarin.Forms.Forms.Init(IActivatedEventArgs launchActivatedEventArgs, IEnumerable`1 rendererAssemblies) at ShowCaseSample.UWP.App.OnLaunched(LaunchActivatedEventArgs e)

c#
xamarin.forms
runtime-error
xamarin.uwp
new-project
asked on Stack Overflow Feb 6, 2018 by Vijay457 • edited Sep 4, 2018 by halfer

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0