Remoting 配置文件遇到的问题
2011-02-12 16:14
197 查看
虽然是个小问题,但是也花了我不少的时间。5555...
在工程中需要调用好几个宿主在windows Service 下的Remoting服务,我起初不知道怎样读取Remoting的配置文件,以至于在调用远程对象时,无法获得服务对象,而只获得的是本地对象。这就是没有读取Remoting配置文件的问题。
所以在Global.asax 文件里
void Application_Start(object sender, EventArgs e)
{
RemotingConfiguration.Configure(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile, false);
}
这样所以得服务就可以用了。
附配置文件:
在工程中需要调用好几个宿主在windows Service 下的Remoting服务,我起初不知道怎样读取Remoting的配置文件,以至于在调用远程对象时,无法获得服务对象,而只获得的是本地对象。这就是没有读取Remoting配置文件的问题。
所以在Global.asax 文件里
void Application_Start(object sender, EventArgs e)
{
RemotingConfiguration.Configure(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile, false);
}
这样所以得服务就可以用了。
附配置文件:
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.runtime.remoting> <application> <client url="tcp://172.16.8.108:4500/FileServer"> <activated type="WebFiles.MailAttachServer,WebFiles" url="tcp://172.16.8.108:4500/FileServer/MailAttachServer" /> <activated type="WebFiles.CFileSvr,WebFiles" url="tcp://172.16.8.172.16.8.108:4500/FileServer/CFileSvr" /> <activated type="WebFiles.CFileIndexSvr,WebFiles" url="tcp://172.16.8.108:4500/FileServer/CFileIndexSvr" /> <activated type="WebFiles.ArchiveFileIndexSvr,WebFiles" url="tcp://172.16.8.108:4500/FileServer/ArchiveFileIndexSvr" /> <activated type="WebFiles.ArchiveFileSvr,WebFiles" url="tcp://172.16.8.108:4500/FileServer/ArchiveFileSvr" /> <activated type="WebFiles.TiffSvr,WebFiles" url="tcp://172.16.8.108:4500/FileServer/TiffSvr" /> </client> <channels> <channel ref="tcp" /> </channels> <client url="tcp://172.16.8.108:4501" name="MailRemoting"> <activated type="WebMail.CAsyncMailSvr,WebMail" url="tcp://172.16.8.108:4501" /> </client> <client url="tcp://172.16.8.108:4503/ExportServer" name="ExportRemoting"> <activated type="WebExport.CWebExport,WebExport" url="tcp://172.16.8.108:4503/ExportServer/CWebExport" /> </client> <client url="tcp://172.16.8.108:4650/IPCService" name="RuntimeServer"> <wellknown type="WFRuntimeServer.IWFRuntimeSrv,IWFRuntimeSrv" url="tcp://172.16.8.108:4650/IPCService/CRuntimeSrv" /> </client> </application> </system.runtime.remoting> </configuration>
相关文章推荐
- Remoting 配置文件遇到的问题
- 关于struts2在struts.xml配置文件遇到的问题
- 有关oracle遇到日期显示问题,导入导出,安装,卸载,修改listener配置文件,创建用户和表空间等的部分问题.
- spring 配置文件中datasource 从properties文件中获取mysql数据库连接参数遇到的问题
- Spring配置web.xml文件时遇到的问题
- 转载VS2008 编译出来的exe文件,运行遇到“应用程序配置不正确,程序无法启动”的问题
- Mybatis配置文件遇到java.lang.Integer can not found问题
- 遇到问题----java----myeclipse或者eclipse发布的项目时配置文件不更新或者无配置文件
- 使用Ajax.net遇到的问题-使用会话时提示错误"只有在配置文件或 Page 指令中将启用会话状态设置为真时,才可以使用会话状态
- dll动态链接库之用类写配置文件和调用判断方法接口的实现中遇到的若干问题
- Centos6.5下rsync文件同步安装及配置当中遇到的问题及解决方法
- 用eclipse配置hibernate的hbm.xml文件时遇到的一些问题
- 在eclipse中发布webservice遇到的两个问题:1.servers资源没有打开 2.配置文件找不到
- 遇到问题----java----myeclipse或者eclipse发布的项目时配置文件不更新或者无配置文件
- 关于使用Entity Framework时遇到的问题 未找到具有固定名称“System.Data.SqlClient”的 ADO.NET 提供程序的实体框架提供程序。请确保在应用程序配置文件的“entityFramework”节中注册了该提供程序
- 今天遇到一个问题,获取properties配置文件中的中文时会出现乱码的情况
- 在阿里云上使用 Docker 并配置阿里云镜像加速器,结果遇到无daemon.json文件无法配置的问题
- 搭建SSH框架遇到的struts.xml找不到spring定义的bean的错误(配置文件的路径问题)
- 写VS配置文件时遇到的一个操蛋问题
- 使用loggin和ConfigParser配置文件中遇到的问题