Alan
Alan

Reputation: 46813

ArgumentNullException during remoting application

I've got a .NET application that uses Remoting between an Administration Console and a Server application.

During a particularly long running remoting call, I will get an error message, displayed below.

I have added the Sponsor to the client to prevent the Remoting connection from being closed, and I have verified the Renew() method is being called.

I've googled the error, but nothing much comes up. I'm not really sure what's the issue here, so any help is appreciated.

Value cannot be null. Parameter name: returnHeaders

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.

Parameter name: returnHeaders

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentNullException: Value cannot be null.

Parameter name: returnHeaders]

System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +7596735

Upvotes: 3

Views: 727

Answers (1)

t0mm13b
t0mm13b

Reputation: 34592

Well, having a look at the Shared Source found on syncfusion.com, and checking the SecurityPermissions attribute here, and I can guess that either the BinaryFormatter (you did not say which?) failed to de-serialize the object in question.

Since you mentioned that it is particularly a long call, it might be worth your while to wrap up the remoting call in a try/catch block and enclose a full stack to see exactly where it is failing...even better, if the InnerException is not null, include that.... Or do something like this...Ok, it may sound hackish... and may fail...

On the server side, create a dummy method...for instance

void FuBar(void){ 
   int foo = 3, bar = 4, baz = 0; 
   baz = foo + bar; 
}

When you call the long running procedure, spawn a thread in the background to repetitively call the FuBar method to ensure that the remoting server does not expire and when the call finishes, kill off the thread...

My guess, is that after a period of time, the remoting call fails, despite renewing the sponsor...

Or it could be the socket is timing out? I'm out of ideas...

Hope this helps, Best regards, Tom.

Upvotes: 3

Related Questions