Print Page | Close Window

Invoke calls are getting an error after we updated to 2012

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2012
Forum Discription: For .NET 4.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3896
Printed Date: 22-Oct-2025 at 12:42am


Topic: Invoke calls are getting an error after we updated to 2012
Posted By: JohnBloom
Subject: Invoke calls are getting an error after we updated to 2012
Date Posted: 16-Jan-2013 at 2:03pm
We are getting an error when we call InvokeServerMethodAsync:

Type 'System.Object[]' is not known to the serializer.

This happens when we pass in parameters to the object[]. If we pass in null then the invoke call will go through. 

Is there a way to add System.Object[] to the serializer?




-------------
-John Bloom



Replies:
Posted By: kimj
Date Posted: 16-Jan-2013 at 3:59pm
There is a way to add known types, but since this was working in DF2010 it's much more likely that the method call isn't quite right.
 
This signature has always been a bit ugly.  Before, you needed to supply a callback and user state, even if null, and then your RPC method arguments.  So something like this:
  manager.InvokeServerMethodAsync("SomeServerType", "SomeMethod", callback, userState, arg1, arg2, ... argN)
 
Now you can instead do:
  await manager.InvokeServerMethodAsync("SomeServerType", "SomeMethod", arg1, arg2, ... argN);
 
If you're supplying a CancellationToken if would come before your arguments.  If you're also referencing the DevForce 2012 Compatibility pack that might confuse things further.
 
 
 


Posted By: JohnBloom
Date Posted: 17-Jan-2013 at 9:18am
Thanks that was exactly the nudge I needed. Removing the callback and userstate did the trick.

-------------
-John Bloom



Print Page | Close Window