diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/CallbackExtensions.cs b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/CallbackExtensions.cs index e5cc40d123..28b93c68b1 100644 --- a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/CallbackExtensions.cs +++ b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/CallbackExtensions.cs @@ -76,7 +76,8 @@ static object InvokeMethod(InvokeRequest request, IReferenceMap referenceMap, ou throw new InvalidOperationException($"Received callback for {deputy.GetType().Name}.{request.Method} getter, but this method does not exist"); } - returnType = methodInfo.GetCustomAttribute()?.Returns; + JsiiMethodAttribute attribute = methodInfo.GetCustomAttribute(); + returnType = attribute?.Returns; return methodInfo.Invoke(deputy, request.Arguments); } @@ -92,14 +93,15 @@ static object InvokeGetter(GetRequest request, IReferenceMap referenceMap, out T throw new InvalidOperationException($"Received callback for {deputy.GetType().Name}.{request.Property} getter, but this property does not exist"); } + JsiiPropertyAttribute attribute = propertyInfo.GetCustomAttribute(); + returnType = attribute?.Type; + MethodInfo methodInfo = propertyInfo.GetGetMethod(); if (methodInfo == null) { throw new InvalidOperationException($"Received callback for {deputy.GetType().Name}.{request.Property} getter, but this property does not have a getter"); } - returnType = methodInfo.GetCustomAttribute()?.Type; - return methodInfo.Invoke(deputy, new object[] { }); } diff --git a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/jsii-runtime/mappings.wasm b/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/jsii-runtime/mappings.wasm deleted file mode 100644 index 9dfc8a6504..0000000000 Binary files a/packages/jsii-dotnet-runtime/src/Amazon.JSII.Runtime/jsii-runtime/mappings.wasm and /dev/null differ