Castle 远程处理示例 - 客户端抛出异常
我正在使用来自 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
替换:
为:
Replace:
with: