Share via

Random Typeload exception regarding httpclient

lufo88 1 Reputation point
2021-02-03T11:11:58.477+00:00

Hi,

I am struggling with a problem in my app which I developed about one year ago with Xamarin.Android
After the last release (mid-january 2021) in appcenter.ms appears random typeload Exception about the namespace System.net.http
The error are like these:
System.TypeLoadException: Could not set up parent class, due to: Could not load type of field 'System.Net.Http.HttpClientHandler:"
System.TypeLoadException: Could not set up parent class, due to: Could not load type of field 'System.Net.Http.HttpClientHandler:<DangerousAcceptAnyServerCertificateValidator>

Note I didn't use DangerousAcceptAnyServerCertificateValidator.

All error seems unrelated to my code, but rather refer to the framework itself and appear at random regarding the brand or the android version.
I tried to simulate the problem, but with no luck. It seems it appear only in release build.

Can you help me?

Developer technologies | .NET | Xamarin

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.