Castle 远程处理示例 - 客户端抛出异常

发布于 2024-10-09 08:06:14 字数 1970 浏览 0 评论 0原文

我正在使用来自 castle @ http://old.castleproject 的示例。 org/container/facilities/trunk/remoting/containersconnected.html 对于“场景:在两个端点上使用容器并使用容器组件”

我对此所做的唯一更新是配置文件中的一行="Castle.Facilities.Remoting.RemotingFacility,Castle.MicroKernel" 到 type="Castle.Facilities.Remoting.RemotingFacility, Castle.Windsor" 正如 Mauricio 在问题中所建议的 Castle远程处理工具无法工作

我还更新了客户端和服务器中的引用以使用最新的 castle dll。服务器启动成功,但客户端无法启动。我在客户端上收到以下异常:

无法设置组件“remote.console.component”。类型“System.Object,mscorlib,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089”未实现服务“Example.Shared.IRemoteConsole,Example.Shared,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null” '。

关于我做错了什么有什么建议吗?

以下是客户端配置文件

<?xml version="1.0"?>
<configuration>
    <configSections>
        <section name="castle" type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor"/>
    </configSections>

    <castle>
        <facilities>
            <facility id="remote.facility"
                type="Castle.Facilities.Remoting.RemotingFacility, Castle.Windsor"
                baseUri="tcp://localhost:2133"
                isClient="true"
                remoteKernelUri="tcp://localhost:2133/kernel.rem"
                remotingConfigurationFile="RemotingTcpConfigClient.config">
            </facility>
        </facilities>

        <components>
            <component
                id="remote.console.component"
                service="Example.Shared.IRemoteConsole, Example.Shared"
                type="System.Object, mscorlib"
                remoteclient="component"/>
        </components>
    </castle>

</configuration>

I am using the sample from castle @ http://old.castleproject.org/container/facilities/trunk/remoting/containersconnected.html for "Scenario: Using the container on both endpoints and use the container components"

The only update I have made to this is one line in the config files from type="Castle.Facilities.Remoting.RemotingFacility, Castle.MicroKernel"
to
type="Castle.Facilities.Remoting.RemotingFacility, Castle.Windsor" as suggested by Mauricio in question Castle remoting facility not working

I also updated the references in both the client and server to use latest castle dlls. The server starts up successfully but the client does not. I get the following exception on the client:

Could not set up component 'remote.console.component'. Type 'System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' does not implement service 'Example.Shared.IRemoteConsole, Example.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

Any suggests on what I am doing wrong?

The following is the client config file

<?xml version="1.0"?>
<configuration>
    <configSections>
        <section name="castle" type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor"/>
    </configSections>

    <castle>
        <facilities>
            <facility id="remote.facility"
                type="Castle.Facilities.Remoting.RemotingFacility, Castle.Windsor"
                baseUri="tcp://localhost:2133"
                isClient="true"
                remoteKernelUri="tcp://localhost:2133/kernel.rem"
                remotingConfigurationFile="RemotingTcpConfigClient.config">
            </facility>
        </facilities>

        <components>
            <component
                id="remote.console.component"
                service="Example.Shared.IRemoteConsole, Example.Shared"
                type="System.Object, mscorlib"
                remoteclient="component"/>
        </components>
    </castle>

</configuration>

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

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

发布评论

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

评论(1

傲性难收 2024-10-16 08:06:14

替换:

<component
       id="remote.console.component"
       service="Example.Shared.IRemoteConsole, Example.Shared"
       type="System.Object, mscorlib"
       remoteclient="component"/>

为:

<component
       id="remote.console.component"
       type="Example.Shared.IRemoteConsole, Example.Shared"
       remoteclient="component"/>

Replace:

<component
       id="remote.console.component"
       service="Example.Shared.IRemoteConsole, Example.Shared"
       type="System.Object, mscorlib"
       remoteclient="component"/>

with:

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