Rhino 8 loading incompatible Azure.Core assembly version for plugin

I’ve having trouble getting my plugin to work with Rhino 8. It’s mostly fine but getting an issue when I use the Azure.Storage.Blobs assembly. This in turn needs Azure.Core and from the debug output it’s loading the version in the Rhino 8/system/netcore folder rather than the one packaged with the plugin. I have assembly redirects configured but I gather this won’t work in .NET core.

This is the error:

'Rhino.exe' (CoreCLR: clrhost): Loaded 'C:\Users\martin\source\repos\PluginConnect\PluginUpload\bin\Azure.Storage.Blobs.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Rhino.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\Rhino 8\System\netcore\Azure.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Rhino.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\x64\shared\Microsoft.NETCore.App\7.0.13\System.Threading.Tasks.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Rhino.exe' (CoreCLR: clrhost): Loaded 'C:\Users\martin\source\repos\PluginConnect\PluginUpload\bin\Azure.Storage.Common.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Exception thrown: 'System.TypeLoadException' in Azure.Storage.Blobs.dll
Exception thrown: 'System.TypeLoadException' in System.Private.CoreLib.dll
Exception thrown: 'System.TypeLoadException' in System.Private.CoreLib.dll
Exception thrown: 'System.TypeLoadException' in System.Private.CoreLib.dll
An exception of type 'System.TypeLoadException' occurred in System.Private.CoreLib.dll but was not handled in user code
Could not load type 'Azure.Core.Pipeline.HttpPipelineOptions' from assembly 'Azure.Core, Version=1.6.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8'.

Version 1.6.0.0 is the one in the Rhino system folder. The version we compiled against is 1.35.0.

Am I missing something? Thanks

You could maybe use the AssemblyResolve event to point it to the correct version?

Thanks for the link - but so far in my attempts a custom AssemblyResolve handler never gets called. I’m guessing the assembly is already loaded somehow.

I’ve also tried loading a specific version directly but it always seems to load the Rhino version. e.g.

Assembly.Load("Azure.Core, Version=1.35.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8");

Results in debug log of 'Rhino.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\Rhino 8\System\netcore\Azure.Core.dll'.

Hi @Martin_Levett,

When you get chance, please review.

Thanks,

– Dale

Thanks Dale. That’s the guide I started with and helped getting Debugging up an running with Rhino 8. As recommended I’m still targetting .NET 4.8. No compatibility issues were found by the compat tool.

It seems specifically related to the Azure.Core assembly. The version that comes with Rhino (1.6.0) seems quite old. Even if that was updated it would be good to have a way to be able to control which assembly version is used by the plugin. Maybe this isn’t feasible.

@curtisw - is this something you can help with?