2012-12-20 19 views
4

嘗試安裝所有我單獨安裝的,從一個試件不斷拋出一個城堡溫莎3.1缺少方法異常

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

儘管該代碼從控制檯應用程序/ Windsows服務的引用完美運行的事實這兩個項目是相同的:

Castle.Core 
Castle.Facilities.FactorySupport 
Castle.Facilities.Logging 
Castle.Facilities.QuartzIntegration 
Castle.Services.Logging.NLogIntegration 
Castle.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"))) 

注:請注意,所有安裝類完美地工作在主運行時應用程序,這在運行單元測試時純粹是一種情景性情況。

感謝您的任何幫助。

+0

以前沒有人有過這個?它不幸地阻止了我的開發 – M05Pr1mty

+0

您在測試項目中是否有對Assembly.WindowsService的引用?你可以代替FromAssembly.Named嘗試一個不使用字符串的方法嗎? – Marwijn

+0

@Marwijn所有參考文獻都存在溫莎和當地的類庫。這已經用每個FromAssmbly方法進行了測試,結果相同,魔術字符串或其他不幸... – M05Pr1mty

回答

1

看起來你有一個老版本的溫莎某處覆蓋新的部署時

+0

感謝您的回覆 - 我會再次檢查 – M05Pr1mty