1

I am developing an app using Xamarin.Forms for android and ios. When running on iOS, I get this error message when calling my WCF:

MonoTouch does not support dynamic proxy code generation. Override this method or its caller to return specific client proxy instance

So, I created this method per Monotouch/WCF: How to consume the wcf service without svcutil :

    protected override IService1 CreateChannel()
    {
        return new Service1ClientChannel(this);
    }

Which led to me having to create the Service1ClientChannel class. Then, per the same link, I implement the methods like so:

        public CheckIfUserNameExistsResponse CheckIfUserNameExists(CheckIfUserNameExistsRequest request)
    {
        object[] _args = new object[1];
        _args[0] = request;
        return (CheckIfUserNameExistsResponse)base.Invoke("CheckIfUserNameExists", _args);
    }

The problem I have is: base.Invoke doesn't exists. Only base.BeginInvoke and base.EndInvoke. So what am I doing wrong? Why in the link above do they have access to "Invoke"? When I checked the ChannelBase definition, there is no "Invoke". Per this link it is supposed to exist: https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.clientbase-1.channelbase-1.invoke?view=xamarinandroid-7.1&viewFallbackFrom=netframework-4.7.2

James Carter
  • 83
  • 1
  • 12
  • Were you able to find the problem, or did you just implement the Begin/End Invoke set? – StingyJack Sep 09 '18 at 15:30
  • 1
    That (frustrating) docs page keeps redirecting me to the Xamarin docs even though I keep choosing netfx 4.7.2 or 4.6.2 or anything else. Is the assembly you are adding this code to targeting netfx, netstandard, or something else? For me its netfx472, which does not have a plain `Invoke()` – StingyJack Sep 09 '18 at 15:37
  • I just implemented the Begin/End Invoke set. As for the assembly i think it is netfx but not sure. I'll look into that. – James Carter Sep 11 '18 at 04:00

1 Answers1

0

I just implemented the Begin/End Invoke set. Still no better solution found. But this solution has worked fine going forward.

James Carter
  • 83
  • 1
  • 12