1

我不断收到以下错误:

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>

该服务在使用添加 Web 参考方法时工作正常。

更新:

我也尝试过配置方法:

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

有任何想法吗?

4

1 回答 1

2

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

于 2011-11-20T21:47:02.467 回答