问题描述
我正在使用城堡中的示例@ 用于方案:在两个端点上使用容器并使用容器组件
我对此所做的唯一更新是将配置文件中的一行从type = Castle.Facilities.Remoting.RemotingFacility,Castle.MicroKernel
更改为
type = Castle.Facilities.Remoting。如毛里西奥(Mauricio)在问题中所建议的那样。 / p>
我还更新了客户端和服务器中的引用,以使用最新的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>
替换:
< 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 />
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"totype="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>
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"/>
这篇关于城堡远程处理示例-客户抛出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!