views:

1013

answers:

5

Hi All

I have a c# application which uses SharpSVN dll and NServicebus dll,it compile fine but when it is executing(in the time of initialize the bus) it throw the following error

Could not load file or assembly 'file:///C:\Repositories\Repo\hooks\SharpSvn-DB44-20-Win32.dll' or one of its dependencies. The module was expected to contain an assembly manifest.

How can I solve the above problem.

Thank in advance Susanta

A: 

I'm not sure if this will help you or not, but I have stumbled on this thread:

http://social.msdn.microsoft.com/Forums/en/vsdebug/thread/9ad17869-63cc-4529-bfaf-9099db500e0d

It appears that a few people have seen this error when building / running assemblies with the same name, so for example:

SomeAssembly.exe
SomeAssembly.dll

Could this be applicable in your case?

Kragen
No, this is not applicable.
Susanta Samanta
+1  A: 

The SharpSvn-DB44-20-Win32.dll is an optional helper dll for SharpSvn.dll. It contains only unmanaged code.

It contains support for directly accessing BDB repositories on the filesystem. You don't need this DLL if you only use fsfs (file://) and/or remote repositories.

The SASL dll is also optional, but you need that when you want to use svn:// repositories.

Bert Huijben
If I only use sharpsvn dll or nServicebus dll in my project then no problem occurs, but when I use both SharpSvn and Nservicebus then(only executing time, not compile time) the above error throws.Kindly give a solution.
Susanta Samanta
+2  A: 

Exclude the sharpsvn dlls from the NServiceBus assemblyscanning by configuring NSB with a explicit list of assemblies toi scan:

Configure.With("List of your assemblies that contain messagehandlers")...

Make sure to include NServiceBus.core.dll in the list if you're using the Saga feature.

Hope this helps!

Andreas
I have configure three dll(NServiceBus.dll,NServiceBus.core.dll,NServiceBus.ObjectBuilder.CastleWindsor.dll) ,then this error is commingType NServiceBus.Unicast.Transport.CompletionMessage was not registered in the serializer. Check that it appears in the list of configured assemblies/types to scan.Please tell me why this error is coming?
Susanta Samanta
The completion message lives in the core dll so you should be fine with the dll:s you mention. Try specifying the core assembly using: typeof(CompletionMessage).Assembly and see if that helps?
Andreas
Can you please specify in details?
Susanta Samanta
Can you post your initialization code here? (the Configure.With(...) stuff)
Andreas
My code is bellow:myDllAssembly.SetValue(Assembly.LoadFile(@"..NServiceBus.dll"), 0); myDllAssembly.SetValue(Assembly.LoadFile(@"..NServiceBus.Core.dll"),1); myDllAssembly.SetValue(Assembly.LoadFile(@"..NServiceBus.ObjectBuilder.CastleWindsor.dll"), 2);Bus = NServiceBus.Configure.With(myDllAssembly).SpringBuilder().MsmqSubscriptionStorage() .XmlSerializer().MsmqTransport().IsTransactional(true).PurgeOnStartup(false) .UnicastBus().ImpersonateSender(false).CreateBus().Start();
Susanta Samanta
try this instead:Configure.With(typeof(CompletionMessage).Assembly,typeof(OneOfYourOwnMessageTypes).Assembly,typeof(OneOfYourOwnMessageHandlers).Assembly)...NServiceBus scan the assemblies for messages and messagehandlers so there is no need to include the ObjectBuilder (NServiceBus.ObjectBuilder.CastleWindsor.dll)Let me know if that works!
Andreas
+1  A: 

Hi The problem get resolved by using the following bus configuration.

Bus = NServiceBus.Configure.With(typeof(IMessage).Assembly, typeof(CompletionMessage).Assembly) .SpringBuilder().MsmqSubscriptionStorage().XmlSerializer().MsmqTransport() .IsTransactional(true).PurgeOnStartup(false).UnicastBus().ImpersonateSender(false) .LoadMessageHandlers().CreateBus().Start();

Thanks to Andreas

Susanta Samanta
+1  A: 

Susanta,

We recently committed an additional API which can be things easier for you by allowing you to specify which assemblies not to load as follows:

Configure.With(AllAssemblies.Except("SharpSvn-DB44-20-Win32.dll"))... // rest of your config

Udi Dahan