Salve, sto relizzando due applicazioni (un servizio windows e un servizio web) che girano sullo stesso pc e comunicano tra di loro utilizzando il .net remoting. Il codice per la pubblicazione del riferimento è più o meno questo:
//SERVER(Servizio windows):
Codice: Seleziona tutto
System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(
new System.Runtime.Remoting.Channels.Http.HttpChannel(1234),false);
RemotingServices.Marshal(_mainInterface, "ASRemoteCheckerInterface");
//CLIENT(Servizio Web)
Codice: Seleziona tutto
System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(
new System.Runtime.Remoting.Channels.Http.HttpChannel(),false);
_mainCheckerInterface = (IMainCheckerInterface)Activator.GetObject(typeof(IMainCheckerInterface),
"http://localhost:1234/ASRemoteCheckerInterface");
Il codice del server è inserito in un metodo OnStart del "servizio windows". Il problema è che il client recupera il riferimento, ma quando va ad usarlo viene sollevata un ceezione, come posso risolvere?