remoting 用app.config文件来配置

<!--服务端配置-->

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

  <system.runtime.remoting>

    <application>

      <service>

        <wellknown

          mode="Singleton"  

          type="DataObjSpace.DataObj,DataObj"

          objecturi="abc.soap"></wellknown>

      </service>

      <channels>

        <channel prot="1234" ref="tcp"></channel>

      </channels>

    </application>

  </system.runtime.remoting>

</configuration>





<!--客户端配置-->

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

  <system.runtime.remoting>

    <application>

      <client>

        <wellknown type="DataObj,DataObj " url="tcp://200.1.3.27:1234/abc.soap"></wellknown>

      </client>

      <channels>

        <channel ref="tcp" prot="0"></channel>

      </channels>

    </application>

  </system.runtime.remoting>

</configuration>
////service remoting code 

RemotingConfiguration.Configure(@"ServiceRemoting.exe.config", false); 





//// Client remoting code 



RemotingConfiguration.Configure(@"ClientRemoting.exe.config", false);







////一句搞定。

你可能感兴趣的:(config)