Loading of Microsoft.AspNetCore.SignalR.Client DLL

Loading of Microsoft.AspNetCore.SignalR.Client DLL

J.Glasbergen
Explorer Explorer
710 Views
1 Reply
Message 1 of 2

Loading of Microsoft.AspNetCore.SignalR.Client DLL

J.Glasbergen
Explorer
Explorer

I'm working on a Revit addin that depends on a package which uses the Microsoft.AspNetCore.SignalR.Client (6.0.13) package.

Microsoft.AspNetCore.SignalR.Client depends on Microsoft.Extensions.Logging.Abstractions (6.0.3) through the following dependencies:

Microsoft.AspNetCore.SignalR.Client
                   |
Microsoft.AspNetCore.SignalR.Client.Common
                   |
Microsoft.Extensions.Logging
                   |
Microsoft.Extensions.Logging.Abstractions


If I create an instance of the class HubConnectionBuilder, [email protected] is always loaded. Even when [email protected] is already loaded as an assembly, in that case it has the two versions loaded.

 

Currently this is causing a crash later on, because the internal logger of SignalR is created with an older version.

 

Adding a AssemblyResolve event handler doesn't work, as the event is not triggered when loading the Microsoft.Extensions.Logging.Abstractions dll. 

I added a github repo in which I added a simple addin in which the scenario can be reproduced.

 

One of my theories was that Revit has a AssemblyResolve event registered that overrides the resolve of the Microsoft.Extensions.Logging.Abstractions dll. I tried to confirm this, by using the fuslog viewer to see which dll loads the v2.2.0 of the Microsoft.Extensions.Logging.Abstractions.dll, unfortunately I could not find any additional information in the logs.

 

Does anyone have an idea why Revit loads v2.2.0 of the Microsoft.Extensions.Logging.Abstractions.dll?

I would expect it to use v6.0.3, as this is already loaded.

 

Creating a IPC application is not an option in our environment.



0 Likes
711 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni

I would suggest disentangling using IPC:

 

  

Sorry, couldn't resist that.

  

Ok, so IPC is not an option.

  

Yes, indeed, you seem to be hitting some DLL dependency collision. Maybe you can use Fuslogvw to at least clarify what is causing the problem:

  

  

I don't really understand how IPC can so totally be ruled out. What harm does it do?

  

Anyway, there are other ways than IPC to split out functionality into separate components and enable very tight communication and coupling between them anyway. What other approach would you prefer?

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open