12

When I try to run my Xamarin app, I get this error in InitializeComponent of App.xaml.cs:

System.MissingMethodException: Method not found: void .ResourceLoadingQuery.set_Instance(object)

I tried cleaning and rebuilding my solution, deleting my obj and bin folders, and restarting Visual Studio as advised here but that didn't seem to help...

edit: I also have a bunch of alleged compile errors in Resource.designer.cs which don't prevent the app from running, but maybe they are causing this problem?

enter image description here

ekolis
  • 6,270
  • 12
  • 50
  • 101

2 Answers2

13

I had the same problem and the solution was to update the NuGet packages in all projects and I had updated only in the main project.

I was building only for android so I also needed to update the NuGet in the android project.

enter image description here

But after that I was getting another error message:

error XF005: The $(TargetFrameworkVersion) for TripLog2.Android (v9.0) is less than the minimum required $(TargetFrameworkVersion) for Xamarin.Forms (10.0). You need to increase the $(TargetFrameworkVersion) for TripLog2.Android.

That was fixed by going into properties of android project and select verion 10 (from previously 9).

enter image description here

I tried selection 11 but that didn't work either and created another set of errors.

Note: I had to quit Visual Studio 2019 and start it again. Changing the version may requires updates and they don't take effect properly if VS is not restarted.

zar
  • 11,361
  • 14
  • 96
  • 178
0

My cause was an invalid App.xaml (Xamarin.Forms resources) file.

Luca Ziegler
  • 3,236
  • 1
  • 22
  • 39