Forum Xamarin.Mac


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Adding to an application

nodoidnodoid GBMember, Beta ✭✭✭


I'm currently part way through porting an iOS app over to macOS. Pretty much everything is done, but when I come to testing I'm getting this error

Method not found: void System.Net.Http.HttpClientHandler.set_AutomaticDecompression(System.Net.DecompressionMethods)

I'm using FubarRestSharp in my mvvm project which from memory uses Microsoft.Net.Http for the decompression. The answer to get rid of this error is to add the Microsoft.Net.Http package from nuget but the problem is that the version on nuget (2.2.29) isn't happy with macOS. I've tried adding a handler in the code calling the web service, but that's not cutting it either.

I've tried just adding a reference back to the packages, but that's not working either.

Any ideas?


  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai


    monodis /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/System.Net.Http.dll
    monodis /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/4.5/System.Net.Http.dll

    both show

        .method public hidebysig specialname 
               instance default void set_AutomaticDecompression (valuetype [System]System.Net.DecompressionMethods 'value')  cil managed 

    So my guess is that you are resolving a copy from a nuget and not the assembly.

    Posting your build log would be helpful to verify this.

Sign In or Register to comment.