每个问题 35分, 单位断网, 明天(星期六)结贴,分不够另外新建帖子送分

cimu 2007-03-23 07:25:53
1 “System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(System.Runtime.Remoting.Channels.IChannel)”
已过时:“Use System.Runtime.Remoting.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity) instead.”
D:\MY_PROJECT\C#2005_PRJ\ObjectServer\RegeditClass\Program.cs 26 13 RegeditClass

2、由于安全限制,无法访问类型 System.Runtime.Remoting.ObjRef。
未处理SerializationException

3、指定的 SOAPAction 无效: "http://schemas.microsoft.com/clr/nsassem/ObjectServer.ISpatialDataManager/VPFTool#sub"
未处理RemotingException

客户端代码:
ChannelServices.RegisterChannel(new HttpChannel());

string uri = "http://192.168.137.1:8828/GisClassLibary/SpatialDataManager";
ObjectServer.ISpatialDataManager obj = null;
obj = (ObjectServer.ISpatialDataManager)Activator.GetObject(typeof(ObjectServer.ISpatialDataManager), uri);

obj.loadMap1(ref axMapControl); // 调用该方法产生以上问题2
//obj.loadMap2();
MessageBox.Show(obj.sub(1, 2).ToString());// 调用该方法产生以上问题3


编译服务器端的宿主程序,产生告警: 问题1
宿主程序代码:
RemotingConfiguration.ApplicationName = "GisClassLibary";

WellKnownServiceTypeEntry SpatialDataManager = new WellKnownServiceTypeEntry(typeof(ObjectServer.SpatialDataManager), "ObjectServer", WellKnownObjectMode.Singleton);
RemotingConfiguration.RegisterWellKnownServiceType(SpatialDataManager);

ChannelServices.RegisterChannel(new HttpChannel(8828));
ChannelServices.RegisterChannel(new TcpChannel(8829));
Console.ReadLine();
...全文
447 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
UltraBejing 2008-04-30
  • 打赏
  • 举报
回复
支持搂主,收藏
叶子 2007-09-18
  • 打赏
  • 举报
回复
3月份的贴子?
panzi667 2007-09-16
  • 打赏
  • 举报
回复
学习中~~
友情UP
北京的雾霾天 2007-03-26
  • 打赏
  • 举报
回复
好像是程序执行的默认用户权限不够.
leixueqiyi 2007-03-26
  • 打赏
  • 举报
回复
应该只是警告,并不妨碍你用。如果非要消除这个警告,可以使用新的RegisterChannel方法,方法保存的路径已经告诉你了在 System.Runtime.Remoting.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity)。

你try一下
江城老温 2007-03-26
  • 打赏
  • 举报
回复
1“System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(System.Runtime.Remoting.Channels.IChannel)”
已过时:“Use System.Runtime.Remoting.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity) instead.”
D:\MY_PROJECT\C#2005_PRJ\ObjectServer\RegeditClass\Program.cs2613RegeditClass
——————————————————

可能需要手工引进新的组件。然后用新的方法解决就OK了。跟2005里用appsetting()方法差不多的情况。
cimu 2007-03-26
  • 打赏
  • 举报
回复
我的系统中不存在 System.Runtime.Remoting.ChannelServices 这样的命名空间, 我用的是VS.NET 2005

其他两个问题都解决了:
问题二: 我传入remoting的参数是一个没有被序列化的对象
问题三: 是由于远程组件的程序集设置不对

另外大家帮忙看看这个问题 : http://community.csdn.net/Expert/topic/5420/5420180.xml?temp=.9574549
jinanjiang 2007-03-25
  • 打赏
  • 举报
回复
up
cimu 2007-03-23
  • 打赏
  • 举报
回复
第二个问题是 在客户端remoting服务器断时产生错误,
cimu 2007-03-23
  • 打赏
  • 举报
回复
你好
第二个问题 是运行期错误,修改编译选项有用吗?

burn3tt 2007-03-23
  • 打赏
  • 举报
回复
1、应该只是警告,并不妨碍你用。如果非要消除这个警告,可以使用新的RegisterChannel方法,方法保存的路径已经告诉你了在 System.Runtime.Remoting.ChannelServices.RegisterChannel(IChannel chnl, bool ensureSecurity)。
2、需要用到unsafe。
3、需要看到完整的异常信息,最好用trycatch捕捉一下打印出来。

8,834

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 组件/控件开发
社区管理员
  • 组件/控件开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧