VB.NET remoting中客户端定义ILease问题

wuhuwy 2009-04-22 05:06:08
我在客户端定义生存期租约对象时,经过调试发现定义的lease总是为Nothing,造成接下来lease.Register(sponsor)出错,请问这是怎么回事
客户端代码如下:

RemotingConfiguration.Configure("Client.exe.config", False)
Dim obj As RemoteType.RemoteType.ClientActivatedType = New _RemoteType.RemoteType.ClientActivatedType()

Dim lease As ILease = CType(obj.GetLifetimeService(), ILease)'就是这里有问题,lease总是为Nothing

Dim sponsor As MyClientSponsor = New MyClientSponsor()
If Not lease Is Nothing Then
lease.Register(sponsor)
End If


客户端配置文件如下:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<channels>
<channel ref="tcp" port="0">
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
</channel>
</channels>
<client url="tcp://localhost:1234">
<activated type="RemoteType.ClientActivatedType, RemoteType" />
</client>
</application>
</system.runtime.remoting>
</configuration>
请高手指点,已经做了一天了,还是没搞定,急!!!
...全文
73 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
wuhuwy 2009-04-23
  • 打赏
  • 举报
回复
无满意答案,结贴了。
slowgrace 2009-04-22
  • 打赏
  • 举报
回复
记得有专门的.net版块。这里专注探讨VB6及其子集。

1,502

社区成员

发帖
与我相关
我的任务
社区描述
VB 网络编程
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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