远程处理错误:找不到请求的服务

发布于 2024-08-25 11:40:20 字数 211 浏览 2 评论 0原文

我正在尝试创建一个非常简单的远程处理示例,但它不起作用。我启动主机,当我启动客户端时,它显示“未找到请求的服务”

我的应用程序的部分内容是:

  1. 远程处理对象:MarshalByRefObject
  2. ComponentHost
  3. 客户端

已经过去 2 天了,我快要疯了。请求是否有人可以告诉我我错在哪里?

I am trying to create a very simple example of remoting which isn't working. I start the host and when I start client, it says "requested service not found"

Parts of My Application are:

  1. Remoting Object : MarshalByRefObject
  2. ComponentHost
  3. Client

It has been 2 days and I am going crazy. Requested if someone can tell that where am I wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

哑剧 2024-09-01 11:40:20

SO 中的问题通常包含出现问题的代码摘要,而不是完整项目的链接。

因为你是新人,所以我还是看了一下。

我可以重现该问题,但不是 .NET 远程专家,我不知道配置部分应该修复什么。互联网搜索返回了大量使用该标签进行注册的样本。

如果您将客户端配置替换为:

        <client>
            <wellknown
            type="MyRemoteObject.Greetings,MyRemoteObject"
            url="tcp://localhost:8737/ComponentHost" />
        </client>        

并将服务器配置替换为:

  <service>
      <wellknown
      mode="Singleton"
      type="MyRemoteObject.Greetings,MyRemoteObject"
      objectUri="ComponentHost"/>
  </service>

它可以正常工作。

Questions in SO normally contain a summary of the code that poses problem, not a link to a complete project.

As you're new, I have taken a look anyway.

I could reproduce the problem, but not being a .NET remoting expert, I do not know what should be fixed in the part of the config. An internet search returns a lot of samples that use the tag for registration.

If you replace your client config by:

        <client>
            <wellknown
            type="MyRemoteObject.Greetings,MyRemoteObject"
            url="tcp://localhost:8737/ComponentHost" />
        </client>        

and the server config by:

  <service>
      <wellknown
      mode="Singleton"
      type="MyRemoteObject.Greetings,MyRemoteObject"
      objectUri="ComponentHost"/>
  </service>

It works fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文