c# remoting调试方法
来源:互联网 发布:大牌护手霜好 知乎 编辑:程序博客网 时间:2024/06/03 19:40
如果在服务器端注册远程对象,则需要在服务器端的app.config中添加如下信息:
<system.runtime.remoting>
<application>
<service>
<wellknown type="CardServer.Service.CardServiceImpl,CardServer" objectUri="CardService" mode="SingleCall" />
</service>
<channels>
<channel ref="tcp" port="8001"/>
</channels>
</application>
</system.runtime.remoting>
同时,需要在服务器端程序中添加 RemotingConfiguration.Configure(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile,
在客户端的app.config中添加如下信息:
<appSettings>
<add key="ServiceURL" value="tcp://192.168.0.111:8001/CardService"/>
</appSettings>
<system.runtime.remoting>
<application>
<service>
<wellknown type="CardServer.Service.CardServiceImpl,CardServer" objectUri="CardService" mode="SingleCall" />
</service>
<channels>
<channel ref="tcp" port="8001"/>
</channels>
</application>
</system.runtime.remoting>
同时,需要在服务器端程序中添加 RemotingConfiguration.Configure(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile,
false),并添加using System.Runtime.Remoting引用;
在客户端的app.config中添加如下信息:
<appSettings>
<add key="ServiceURL" value="tcp://192.168.0.111:8001/CardService"/>
</appSettings>
如若在同一台电脑上测试服务器端接口程序,则ServiceURL的value设置为本机的ip地址,端口号为服务器端设置的port="8001"。然后,分别运行服务器或客户端下bin文件->debug文件下的.exe程序,另一程序(客户端或服务器)打断点调试,分析运行结果。
注:1、类库工程dll,若更改该dll,在其他工程中引用的该dll若不想每次重新添加,可以通过添加引用,进入引用管理界面,在界面左侧选中Projects,添加该dll,
后续该dll更改后,添加到其他工程的dll自动更改,不需要再次添加。
2、查看服务器端口是否启动,通过cmd->netstat -ano命令查看。
3、服务器和客户端在同一台电脑上联调,可以把tcp设置为:127.0.0.1,对应的端口号大于1024即可。
阅读全文
0 0
- c# remoting调试方法
- C# remoting
- C# Remoting
- C# Remoting Demo
- c# remoting 小实例
- c# Remoting分布式开发
- c# remoting 小实例
- c# remoting 小实例
- C# Remoting TcpChannel
- C# Remoting 简单实现
- C#学习笔记:.NET Remoting
- Remoting in .NET Using C#
- Tomcat Remoting Debug设置方法
- Remoting中的方法回调
- c# 调试Windows服务程序的方法
- c# 调试Windows服务程序的方法
- C# 调试方法之即时窗口输出
- C# webservice服务跟踪调试方法
- (一)java基础篇笔记库(12)
- js调用百度地图api
- 相机标定
- Spring整合JMS(消息中间件)
- 目标检测--Light-Head R-CNN: In Defense of Two-Stage Object Detector
- c# remoting调试方法
- Cannot publish to the server because it is missing its runtime environment.
- VB模块
- ceshi
- 【第十三周项目1】验证算法--分块查找算法
- 第十一周项目三
- 2017.11.08更新-最新PLA1.2/Guideline5.2.1被拒,官方审核人员解决方案
- 阿里智能对话交互技术实践与创新
- ONVIF协议网络摄像机(IPC)客户端程序开发(12):读取音视频流