dynamic type avec .net Remoting
Bonjour,
j'essaie d'utiliser .net Remoting avec le nouveau type dynamc du .net 4.0.
Voici un extrait de mon code qui
- charge une assembly contenant les types utilisés par le client du Remoting
- essaie de faire un appel au serveur
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
Assembly ass = Assembly.LoadFile(assemblyPath);
dynamic crm = ass.CreateInstance("CrmDll.CrmTiersFactory");
dynamic client = crm.getCrmClient(companyId);
TcpChannel tcp = new TcpChannel();
ChannelServices.RegisterChannel(tcp, false);
string url = "ServerUrl";
TypeConverter tc = TypeDescriptor.GetConverter(ass.GetType("CrmDll.IRemoteOperation"));
dynamic remoteOperation = tc.ConvertFrom( Activator.GetObject
(
ass.GetType("CrmDll.IRemoteOperation")
, url
)); |
L'interface IRemoteOperation est dans la Dll chargée mais à l'éxécution, j'ai sur la dernière ligne de mon extrait l'exception NotSupportedException
Citation:
Conversion de ReferenceConverter impossible à partir de System.MarshalByRefObject.
si quelqu'un a une idée, je suis preneur
Bonne journée