Hello,
I have strange situation on hand , I have remotely exposed an object through Windows serice. I am using Client Activated Objects(CAO) . Now whenever I try to create an proxy object on the client, I get an Target Innvocation exception, this is when the service is running . Everything works great when I stop the service and start the .exe for the service. I initially thought this can be authentication issue.
I tried running the service under Administrator login but of no use.
Can someone please help,it's Urgent.
Here is the code:
BinaryServerFormatterSinkProvider serverProv = new BinaryServerFormatterSinkProvider();
serverProv.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilter Level.Full;
BinaryClientFormatterSinkProvider clientProv = new BinaryClientFormatterSinkProvider();
System.Collections.IDictionary props = new System.Collections.Hashtable();
props["port"] = 0;
TcpChannel chan = new TcpChannel(props, clientProv, serverProv);
ChannelServices.RegisterChannel(chan);
RemotingConfiguration.RegisterActivatedClientType( typeof(FigMDClient.Classes.RemoteDataAccess), "tcp://Dev009:8080/RemoteDataAccess");
objRemoteDataAccess = new FigMDClient.Classes.RemoteDataAccess();// Exception thrown here.