1

In a C# project I need to make a backplane for SignalR realized with Azure Service Bus. So in the startup I wrote:

GlobalHost.DependencyResolver.UseServiceBus(asb_endpoint, topic);

in the same project there's even a Rebus configuration for Azure Service Bus, something like:

return Rebus.Config.Configure.With(new UnityContainerAdapter(container))
            .Logging(l => l.Log4Net())
            .Transport(l => l.UseAzureServiceBus(cs, qname))
            .Routing(r => r.TypeBasedRoutingFromAppConfig())
            .Options(o => o.SimpleRetryStrategy(errorQueueAddress: errorqname, maxDeliveryAttempts: 3));

both uses extension method for implementation of UseAzureServiceBus and UseServiceBus.

The problem is: both extension methods are part of two libraries, and this libraries conflicting on various dependencies. To have Rebus' UseAzureServiceBus extension, I need Rebus.AzureServiceBus version 0.99.39, which in turn needs at least WindowsAzure.ServiceBus 3.0.4, but this use a DLL called Microsoft.ServiceBus 3.0.0 that conflicts with the internal work of extension method UseServiceBus.

How can I handle this?

EDIT 1 : Looks like this problem will be fixed with Microsoft.AspNet.SignalR.ServiceBus version 2.2.2. I don't know what to do in meanwhile

BAD_SEED
  • 4,840
  • 11
  • 53
  • 110
  • You can do nothing with it at the moment. There are some attempts to resolve this problem in SignalR, I mean, so developers branched original project and made necessary changes. You can make your own build of SignalR for some time. – cassandrad Apr 07 '17 at 12:42

1 Answers1

1

it sounds like you need to give each assembly an alias, then you can specifically use the class in that version.

see:

What use is the Aliases property of assembly references in Visual Studio 8

MSDN: https://msdn.microsoft.com/en-us/library/ms173212.aspx

here is a good walkthrough: https://blogs.msdn.microsoft.com/ansonh/2006/09/27/extern-alias-walkthrough/

enter image description here

  extern alias FooVersion1;


  FooVersion1::Acme.Foo f = new FooVersion1::Acme.Foo();
  f.Bar();

The other option you have is to use the global alias that is on by default, you can then use global then the full namespace of the class you need to use if it exists in 2 different assemblies.

eg:

global::Assembly1.Class1 c = new global::Assembly1.Class1();
global::Assembly2.Class1 c2 = new global::Assembly2.Class1();
Community
  • 1
  • 1
WraithNath
  • 17,658
  • 10
  • 55
  • 82
  • How can I have both version as soon project is started? I need an xcopy or something like that? – BAD_SEED Apr 07 '17 at 10:45
  • Can you abstract out the code for one version into one assembly, and the code for the other version into another assembly each with their own set of references, then just call assembly 1 on startup and assembly 2 on start up? other than that you might be able to do some assembly binding redirects in the web config? – WraithNath Apr 07 '17 at 10:52