簡體   English   中英

Castle Windsor 3.1缺失方法例外

[英]Castle Windsor 3.1 Missing Method Exception

試圖從測試組件安裝我所有的單獨安裝程序一直在投擲

 "`{"Method not found: 'Castle.MicroKernel.Registration.ComponentRegistration1<!0> Castle.MicroKernel.Registration.ComponentRegistration1.DependsOn(Castle.MicroKernel.Registration.Dependency)'."}`" 

盡管代碼從Console應用程序/ Windsows服務完美運行,但兩個項目的引用完全相同:

Castle.Core
Castle.Facilities.FactorySupport
Castle.Facilities.Logging
Castle.Facilities.QuartzIntegration
Castle.Services.Logging.NLogIntegration
Castle.Windsor

有沒有人知道為什么測試組件如此調用windsor容器的構建:

   this.Container = new WindsorContainer(new XmlInterpreter())
       .Install(FromAssembly.Named("Assembly.WindowsService", 
                new CustomWindsorInstallerFactory()));

在引用“DependsOn”方法的任何代碼上失敗,例如:

container.Register(
    Component
         .For<ISftpRepository, ISftpFileStoreRepository, AbstractSftpFileStoreRepository>()
         .ImplementedBy<ConcreteSftpRepository>()
         .Properties(PropertyFilter.IgnoreAll)
         .DependsOn(
              Dependency.OnConfigValue("host", config.Host),

要么:

.ConfigureFor<QuartzJob>(
      x => 
      x.DependsOn(ServiceOverride.ForKey<IService>().Eq("intraService")))

注意:請注意所有安裝類在主應用程序下運行時都能正常工作,這在運行單元測試時純粹是一種情境。

謝謝你的幫助。

看起來你有一個較舊版本的Windsor在部署時會覆蓋新版本

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM