我们使用 nettiers 作为我们的数据层,最近我们开始考虑使用 NServiceBus,但我们碰壁了。
我们有一个 Windows 服务,它托管 NSB 并引用我们的 Nettiers 程序集。
遇到以下行时,服务将引发异常。
var Bus = Configure.With().SpringBuilder()
.XmlSerializer()
.MsmqTransport()
.IsTransactional(false)
.PurgeOnStartup(false)
.UnicastBus()
.ImpersonateSender(false)
.CreateBus()
.Start();
抛出的异常是:
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
加载程序异常消息是:
Could not load file or assembly 'Microsoft.Practices.Unity, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.":"Microsoft.Practices.Unity, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
堆栈跟踪是:
at System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark)
at System.Reflection.Assembly.GetTypes()
at NServiceBus.Configure.<>c__DisplayClass1.<With>b__0(Assembly a) in d:\BuildAgent-03\work\672d81652eaca4e1\src\config\NServiceBus.Config\Configure.cs:line 122
at System.Array.ForEach[T](T[] array, Action`1 action)
at NServiceBus.Configure.With(Assembly[] assemblies) in d:\BuildAgent-03\work\672d81652eaca4e1\src\config\NServiceBus.Config\Configure.cs:line 122
at NServiceBus.Configure.With(IEnumerable`1 assemblies) in d:\BuildAgent-03\work\672d81652eaca4e1\src\config\NServiceBus.Config\Configure.cs:line 111
at NServiceBus.Configure.With(String probeDirectory) in d:\BuildAgent-03\work\672d81652eaca4e1\src\config\NServiceBus.Config\Configure.cs:line 101
at NServiceBus.Configure.With() in d:\BuildAgent-03\work\672d81652eaca4e1\src\config\NServiceBus.Config\Configure.cs:line 78
at MessageSender.Program.Main(String[] args) in C:\Development\NSBTest4\MessageSender\Program.cs:line 18
没有 nettiers 参考 NSB 工作正常。知道问题是什么以及如何解决吗?
谢谢。