views:

249

answers:

1

We use nettiers as a our data layer, and we recently have started looking at using NServiceBus, but we have hit a wall.

We have a windows service which hosts NSB and references our Nettiers assembly.

the service is throwing an exception when the following line is encountered.

var Bus = Configure.With().SpringBuilder()
            .XmlSerializer()
            .MsmqTransport()
                .IsTransactional(false)
                .PurgeOnStartup(false)
            .UnicastBus()
                .ImpersonateSender(false)
            .CreateBus()
            .Start();

the exceptions that is throw is:

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

the loader exception message is:

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

stacktrace is:

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

without the nettiers reference NSB works fine. Any idea what the problem is and how to solve it?

thanks.

A: 

You can exclude the nettiers dll from scanning using With(AllAssemblies.Except("name of nettiers dll"))...

Andreas
Thanks for the suggestion, but unfortunately it didn't make any difference.the nettiers assemblies are referenced in DataLayer.dllwhich is in turn referneced by my NSB project.so i added the With(AllAssemblies.Except("DataLayer.dll"))but had no affect.
IGoor
Can you make sure that both your datalayer.dll and the nettiers dll is excluded using: AllAssemlies.Except("datalayer.dll").And("nettiers.dll")?
Andreas
yeah. we tried that without any luck.we go it working in the end by specifying what assemblies to include:With(typeof(IMessage).Assembly, typeof(MessageItem.MessageItem).Assembly, typeof(NServiceBus.Unicast.Transport.CompletionMessage).Assembly, typeof(MessageReceiver.MessageHandler).Assembly)
IGoor