Remoting 版本错误问题
客户端
System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider bcfProd=new BinaryClientFormatterSinkProvider( );
System.Runtime.Remoting.Channels.Http.HttpChannel htcal=new HttpChannel(null,bcfProd,null);
ChannelServices.RegisterChannel(htcal);
RemotingConfiguration.RegisterWellKnownClientType( typeof(ApplyRemoteCS_Server.ApplyServerLib), "http://localhost/NullWebApply/ApplyServerLib.rem");
ApplyServerLib applyServer=new ApplyServerLib();
然后一调用方法就报{"BinaryFormatter 版本不兼容。应为版本 1.0。接收到的版本为 1008738336.1684104552。" }
服务端是一个简单的dll 只有一个方法 返回一个字符串;寄主是IIS
服务端配置 WebConfig。config
<system.runtime.remoting>
<application>
<service>
<wellknown
mode="SingleCall"
objectUri="ServerSide.rem"
type="ApplyRemoteCS_Server.ApplyServerLib, ApplyRemoteCS_Server" />
</service>
</application>
</system.runtime.remoting>