【问题标题】:error resolving WCF service using WCF facility使用 WCF 工具解析 WCF 服务时出错
【发布时间】:2011-11-20 21:22:51
【问题描述】:

我不断收到以下错误:

Method not found: 'Void Castle.MicroKernel.ComponentActivator.ComponentActivatorException..ctor

这是来自 global.asax 中的以下初始化代码:

    private void ConfigureContainer()
    {
        _container = new WindsorContainer();

        _container.Register(Component.For<IWindsorContainer>().Instance(_container))
            .AddFacility<WcfFacility>()
            .Register(Component.For<ISonatribeCommandService>()
                          .AsWcfClient(DefaultClientModel
                          .On(WcfEndpoint.FromConfiguration("commandServiceClient")))
                          .LifestyleTransient())
            .Install(FromAssembly.InDirectory(new AssemblyFilter(HttpRuntime.BinDirectory, "Sonatribe*.dll")));

    }

web.config 中的 system.servicemodel 部分如下所示:

  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    <client>
      <endpoint address="http://****.com/SonatribeCommandService.svc" binding="basicHttpBinding" contract="CommandService.ISonatribeCommandService" name="commandServiceClient"></endpoint>
    </client>
  </system.serviceModel>

使用添加网络引用方法时服务运行良好。

更新:

我也尝试过配置方法:

<configuration>
  <components>
    <component 
      id="commandService" 
      type="CommandService.SonatribeCommandService, CommandService"
      wcfEndpointConfiguration="commandServiceClient" />
  </components>
</configuration>

有什么想法吗?

【问题讨论】:

    标签: c# wcf castle-windsor wcffacility


    【解决方案1】:

    您使用的似乎是不兼容的 Windsor 版本和该设施。确保您使用的 WCF Facility 版本旨在与您拥有的 Windsor 版本一起使用。

    【讨论】:

    • 这并没有降低它的可能性,特别是如果您使用 nuget UI。确保它们具有相同的版本。
    • 抱歉,删除,重新获取,然后重建
    • gah:
    • 我只是要回去运行我自己的构建...感谢您的帮助
    • 为什么要使用自己的版本而不是官方版本?只需将 WCF 设施升级到 RC1,对吗?
    猜你喜欢
    • 2015-03-10
    • 2011-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-29
    相关资源
    最近更新 更多