Search code examples
xamarin.formstypeloadexception

Xamarin forms UWP: Exception thrown: 'System.TypeLoadException' in System.Private.CoreLib.ni.dll


Getting the following exception after updating xamarin forms.

Exception thrown: 'System.TypeLoadException' in System.Private.CoreLib.ni.dll An exception of type 'System.TypeLoadException' occurred in System.Private.CoreLib.ni.dll but was not handled in user code Could not load type 'Xamarin.Forms.Xaml.XamlResourceIdAttribute' from assembly 'Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'.

I have this problem after installing xamarin forms 3.1.0.912540 from 2.5.0.121934.

Screenshot adding below:

enter image description here


Solution

  • The issue is already reported in the xamarin forums and the solution is to

    • Clean all projects in solution
    • close Visual Studio
    • Remove all bin and obj folders from all projects (shared and device (Android, iOS, UWP) specific)
    • Restart IDE, build the solution.