Karam Ramadan
Karam Ramadan

Reputation: 29

System.TypeLoadException occurred when i try to compile

System.TypeLoadException'Could not resolve type with token 01000016 from typeref (expected class 'Xamarin.Forms.Xaml.Diagnostics.VisualDiagnostics' in assembly 'Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null')'

this is the App.cs File where this error appears :

namespace NewApp

{

    public partial class App : Application

    {

        public App()

        {

            InitializeComponent(); // GETTING THE ERROR
            Material.Init(this);
            MainPage = new MaterialNavigationPage(new MainPage());

        }
    }
}

Upvotes: 1

Views: 5588

Answers (3)

Jabuthan
Jabuthan

Reputation: 11

Same thing happened to me during an upgrade of Xamarin.Forms.

The issue seemed to have only been isolated to the iOS build.

To fix this issue, remove the Xamarin.Forms dependency from all the projects in the solution and reinstall Xamarin.Forms through nuget.

Then Clean All --> Rebuild All

Upvotes: 1

user2251213
user2251213

Reputation: 1

I had same problem.

Just check if the Xamarin packages are the same version in /Packages, and /Dependencies/NuGet folders.

After that, Clean All and Rebuild All.

Upvotes: 0

Ashandra Singh
Ashandra Singh

Reputation: 198

I had the same issue when I added the NUGET package Xamarin.Forms.

Check your Android Xamarin.Forms NuGet Package and the same for your IOS project.

You will notice your versions are not matching.

Right click update on each package to update to the latest version.

Do this for all including the Xamarin main project. Then delete the bin and obj folder for each project in your file system. Xamarin, IOS and Android.

Rebuild. Then launch. Should work for you as well.

Upvotes: 12

Related Questions