Skip to content

IProgress Callee Registration Fails on Xamarin.Android #268

Closed
@StevenBonePgh

Description

@StevenBonePgh

When registering a reflection-based callee with an IProgress parameter on Xamarin.Android an index out of range exception is thrown. This worked in 18.3.2, I first noticed it broken in 18.8.2, and it remains broken in 18.8.5. On .NET 4.7.1 and Xamarin.UWP the callee registers just fine. I do not have a Mac to check that platform, sorry.

The interface method likely causing the issue looks like this:

[WampProcedure("my.getfoo")]
[WampProgressiveResultProcedure]
Task<FooChunk> GetFooAsync(string fooName, IProgress<FooChunk> progress);

The exception happens when calling Channel.RealmProxy.Services.RegisterCallee with the object implementing that interface.

{System.IndexOutOfRangeException} "Index was outside the bounds of the array."
  at System.Attribute.InternalParamIsDefined (System.Reflection.ParameterInfo parameter, System.Type attributeType, System.Boolean inherit) [0x0003b] in <43dbbdc147f2482093d8409abb04c233>:0 
  at System.Attribute.IsDefined (System.Reflection.ParameterInfo element, System.Type attributeType, System.Boolean inherit) [0x00071] in <43dbbdc147f2482093d8409abb04c233>:0 
  at System.Attribute.IsDefined (System.Reflection.ParameterInfo element, System.Type attributeType) [0x00000] in <43dbbdc147f2482093d8409abb04c233>:0 
  at System.Reflection.CustomAttributeExtensions.IsDefined (System.Reflection.ParameterInfo element, System.Type attributeType) [0x00000] in <43dbbdc147f2482093d8409abb04c233>:0 
  at WampSharp.V2.Rpc.MethodInfoValidation.ValidateTupleReturnTypeOfProgressiveMethod (System.Reflection.MethodInfo method, System.Reflection.ParameterInfo lastParameter) [0x00000] in D:\a\1\s\src\net45\WampSharp\WAMP2\V2\Rpc\Callee\Reflection\MethodInfoValidation.cs:126 
  at WampSharp.V2.Rpc.MethodInfoValidation.ValidateProgressiveMethod (System.Reflection.MethodInfo method) [0x00081] in D:\a\1\s\src\net45\WampSharp\WAMP2\V2\Rpc\Callee\Reflection\MethodInfoValidation.cs:121 
  at WampSharp.V2.Rpc.OperationExtractor.CreateRpcMethod (System.Func`1[TResult] instanceProvider, WampSharp.V2.ICalleeRegistrationInterceptor interceptor, System.Reflection.MethodInfo method) [0x00040] in D:\a\1\s\src\net45\WampSharp\WAMP2\V2\Rpc\Callee\Reflection\OperationExtractor.cs:69 
  at WampSharp.V2.Rpc.OperationExtractor+<GetServiceMethodsOfType>d__2.MoveNext () [0x00060] in D:\a\1\s\src\net45\WampSharp\WAMP2\V2\Rpc\Callee\Reflection\OperationExtractor.cs:47 
  at WampSharp.V2.Rpc.OperationExtractor+<ExtractOperations>d__0.MoveNext () [0x000aa] in D:\a\1\s\src\net45\WampSharp\WAMP2\V2\Rpc\Callee\Reflection\OperationExtractor.cs:21 
  at WampSharp.V2.WampRealmProxyServiceProvider.RegisterCallee (System.Type type, System.Func`1[TResult] instanceProvider, WampSharp.V2.ICalleeRegistrationInterceptor interceptor) [0x00047] in D:\a\1\s\src\net45\WampSharp\WAMP2\V2\Api\Client\WampRealmProxyServiceProvider.cs:70 
  at WampSharp.V2.WampRealmProxyServiceProvider.RegisterCallee (System.Object instance, WampSharp.V2.ICalleeRegistrationInterceptor interceptor) [0x0000d] in D:\a\1\s\src\net45\WampSharp\WAMP2\V2\Api\Client\WampRealmProxyServiceProvider.cs:39 

I have a CalleeRegistrationInterceptor, and right after it calls GetProcedureUri for the method in question is when the exception is thrown, which is why I suspect the above procedure is the guilty party. There seems to have been a large code churn in the areas in the call stack from when I confirmed it worked, but in a quick glance it was not obvious to me where the issue happens to be. Any ideas? I can try to nail it down further Monday if need be.

Thanks, Elad!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions