System.MissingMethodException: Method 'System.Collections.Generic.Dictionary`2.GetValueOrDefault' not found

1.4k views Asked by At

I'm working on Xamarin.droid application which was running fine till yesterday. But suddenly when I try to run the code I'm getting the exception on runtime once the project started to run on device

System.MissingMethodException: Method 'System.Collections.Generic.Dictionary`2.GetValueOrDefault' not found.

I removed all the code changes and let it be in the previous working state.
Cleaned and rebuilt the project.
Removed bin and obj folders.
Linker property is already set to "None".
Removed unnecessary packages.
Restarted Visual studio. Restarted the system. But still no use.

Using Visual studio enterprise 15.5.7.

Any help is appreciated...

Edited: It got resolved in my case. I run the app from VS, it throws the exception. Then I opened the app settings and cleared cache/data. Then opened the app. It worked as expected. Then run the app from VS. Then also it worked without throwing the exception. But don't know what exactly went wrong previously.

1

There are 1 answers

3
Sepehr Davarnia On

Most of the time that I have seen this exception using Xamarin, it was something related to Linker configuration and compiler optimizations.