服务器端配置文件事件如下:
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="Singleton"
type="Inovout.Remoting.RemotingObject.Calcuator,RemotingObjectClassLibrary"
objectUri="Calculator.rem"/>
</service>
<channels>
<channel ref="tcp" port="8891"/>
</channels>
</application>
</system.runtime.remoting>
</configuration>
客户端配置文件事例如下:
<configuration>
<system.runtime.remoting>
<system.runtime.remoting>
<application>
<client>
<wellknown
type="Inovout.Remoting.RemotingObject.Calcuator,RemotingObjectClassLibrary"
url="tcp://localhost:8891/Calculator.rem"
/>
</client>
<channels>
<channel
ref="tcp"/>
</channels>
</application>
</system.runtime.remoting>
</system.runtime.remoting>
</configuration>
注册方法事例代码如下:
// ClientWindowsApplication.exe.config为客户端或服务器端配置文件名。
RemotingConfiguration.Configure("ClientWindowsApplication.exe.config", true);