[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

InvalidCastException when register the remoting interface to GAC

Antoine Veret

9/29/2004 3:50:00 PM

Hi, i am using Remoting with between a Windows Service and a WebService. On
each side, there is a Dll contain the remoting interface and various data
class marked a Serializable. these classes are used as parameter in remoting
methods.

Since i have register my Dll into GAC, an exception is thrown :

System.InvalidCastException: Return argument has an invalid type.
at System.Runtime.Remoting.Proxies.RealProxy.ValidateReturnArg(Object arg,
Type paramType)
at System.Runtime.Remoting.Proxies.RealProxy.PropagateOutParameters(IMessage
msg, Object[] outArgs, Object returnValue)
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at SOMA.Connection.IRemoteConnector.GetForm(Int32 DARID, Int32 priority)
at SOMAWebService.Service.TryToSendMessage(Int32 darid, Int32 priority) in
c:\inetpub\wwwroot\somawebservice\service.asmx.cs:line 291

the type which is returned by the method is described by the class :

[Serializable]
public class TransactionElement
{
private FormKey _key = null;
private string _xmlForm = null;

public TransactionElement(FormKey key, string xmlForm)
{
_key = key;
_xmlForm = xmlForm;
}

public FormKey Key
{
get
{
return _key;
}
}

public string XmlForm
{
get
{
return _xmlForm;
}
}
}

Any idea ?

--
Antoine VERET
3IE (http://w...)