【问题标题】:Castle remoting sample - client throwing exceptionCastle 远程处理示例 - 客户端抛出异常
【发布时间】:2010-12-29 20:57:53
【问题描述】:

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

我对此所做的唯一更新是配置文件中的一行来自 type="Castle.Facilities.Remoting.RemotingFacility, Castle.MicroKernel" 到 type="Castle.Facilities.Remoting.RemotingFacility, Castle.Windsor" 正如 Mauricio 的建议 Castle remoting facility not working

我还更新了客户端和服务器中的引用以使用最新的城堡 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>

【问题讨论】:

    标签: castle-windsor remoting


    【解决方案1】:

    替换:

    <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"/>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-18
      • 2017-12-20
      • 2019-07-27
      相关资源
      最近更新 更多