因为你在服务器端将两个对象起的名字都是“
server"
应改为:
HttpServerChannel httpChannel = new HttpServerChannel(8085);
ChannelServices.RegisterChannel(httpChannel);
RemotingConfiguration.RegisterWellKnownServiceType(
typeof (A),
"Server1",
WellKnownObjectMode.Singleton);
RemotingConfiguration.RegisterWellKnownServiceType(
typeof (B), 
"Server2",
WellKnownObjectMode.Singleton);
然后再客户端获取其透明代理:
ChannelServices.RegisterChannel(new HttpClientChannel());
A a = (A)Activator.GetObject(
typeof(A),
"http://localhost:8085/Server1");
B b = (B)Activator.GetObject(
typeof(B),
"http://localhost:8085/Server2");