Connecting to a SignalR dotnet Core Hub crashes Revit

Connecting to a SignalR dotnet Core Hub crashes Revit

PhillipM
Advocate Advocate
1,383 Views
10 Replies
Message 1 of 11

Connecting to a SignalR dotnet Core Hub crashes Revit

PhillipM
Advocate
Advocate

Has anyone had any luck Connecting to a .Net Core SignalR Hub?  Every time I try Revit crashes.  I have successfully connected to a asp.net SignalR hub.

 

There seems to be some sort of conflict with Revit.

 

Any suggestions?

 

Cheers

 

Phillip

0 Likes
1,384 Views
10 Replies
Replies (10)
Message 2 of 11

jeremy_tammik
Alumni
Alumni

You could research which third party DLLs are being loaded for your connection. There may indeed be some conflict with the DLLs loaded by Revit. Fuslogv might help:

 

https://thebuildingcoder.typepad.com/blog/2021/05/revitlookup-update-fuslogvw-and-override-joins.htm...

  

 

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 11

PhillipM
Advocate
Advocate

HI Jeremy.

 

Thanks for your suggestion to run Fuslog.  I have tried that and all looks good.  The dll it is loading is 

Microsoft.AspNetCore.SignalR.Client 

And it has loaded fine.  I have attached it for reference.

 

Any other ideas at all?

 

Cheers

 

Phillip 

 

*** Assembly Binder Log Entry  (18/03/2022 @ 9:22:20 am) ***

The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable  C:\Program Files\Autodesk\Revit 2022\Revit.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.AspNetCore.SignalR.Client, Version=3.1.20.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files/Autodesk/Revit 2022/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = Revit.exe
Calling assembly : SignalRCoretest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\Program Files\Autodesk\Revit 2022\Revit.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.AspNetCore.SignalR.Client, Version=3.1.20.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/Microsoft.AspNetCore.SignalR.Client/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/SDA/bin/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/SDA/bin/Microsoft.AspNetCore.SignalR.Client/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/CefSharp/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/CefSharp/Microsoft.AspNetCore.SignalR.Client/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/Addins/RaasForRevit/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/Addins/RaasForRevit/Microsoft.AspNetCore.SignalR.Client/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/Microsoft.AspNetCore.SignalR.Client.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/Microsoft.AspNetCore.SignalR.Client/Microsoft.AspNetCore.SignalR.Client.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/SDA/bin/Microsoft.AspNetCore.SignalR.Client.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/SDA/bin/Microsoft.AspNetCore.SignalR.Client/Microsoft.AspNetCore.SignalR.Client.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/CefSharp/Microsoft.AspNetCore.SignalR.Client.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/CefSharp/Microsoft.AspNetCore.SignalR.Client/Microsoft.AspNetCore.SignalR.Client.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/Addins/RaasForRevit/Microsoft.AspNetCore.SignalR.Client.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/Addins/RaasForRevit/Microsoft.AspNetCore.SignalR.Client/Microsoft.AspNetCore.SignalR.Client.EXE.
LOG: Attempting download of new URL file:///C:/Users/phill/source/repos/SignalRCoretest/SignalRCoretest/bin/Debug/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Users\phill\source\repos\SignalRCoretest\SignalRCoretest\bin\Debug\Microsoft.AspNetCore.SignalR.Client.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Microsoft.AspNetCore.SignalR.Client, Version=3.1.20.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
LOG: Where-ref bind Codebase does not match what is found in default context. Keep the result in LoadFrom context.
LOG: Binding succeeds. Returns assembly from C:\Users\phill\source\repos\SignalRCoretest\SignalRCoretest\bin\Debug\Microsoft.AspNetCore.SignalR.Client.dll.
LOG: Assembly is loaded in LoadFrom load context.

</pre></html><meta http-equiv="Content-Type" content="charset=unicode-1-1-utf-8"><!-- saved from url=(0015)assemblybinder: --><html><pre>
*** Assembly Binder Log Entry  (18/03/2022 @ 9:22:20 am) ***

The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable  C:\Program Files\Autodesk\Revit 2022\Revit.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.AspNetCore.SignalR.Client, Version=3.1.20.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files/Autodesk/Revit 2022/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = Revit.exe
Calling assembly : SignalRCoretest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\Program Files\Autodesk\Revit 2022\Revit.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.AspNetCore.SignalR.Client, Version=3.1.20.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/Microsoft.AspNetCore.SignalR.Client/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/SDA/bin/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/SDA/bin/Microsoft.AspNetCore.SignalR.Client/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/CefSharp/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/CefSharp/Microsoft.AspNetCore.SignalR.Client/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/Addins/RaasForRevit/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/Addins/RaasForRevit/Microsoft.AspNetCore.SignalR.Client/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/Microsoft.AspNetCore.SignalR.Client.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/Microsoft.AspNetCore.SignalR.Client/Microsoft.AspNetCore.SignalR.Client.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/SDA/bin/Microsoft.AspNetCore.SignalR.Client.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/SDA/bin/Microsoft.AspNetCore.SignalR.Client/Microsoft.AspNetCore.SignalR.Client.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/CefSharp/Microsoft.AspNetCore.SignalR.Client.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/CefSharp/Microsoft.AspNetCore.SignalR.Client/Microsoft.AspNetCore.SignalR.Client.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/Addins/RaasForRevit/Microsoft.AspNetCore.SignalR.Client.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Autodesk/Revit 2022/Addins/RaasForRevit/Microsoft.AspNetCore.SignalR.Client/Microsoft.AspNetCore.SignalR.Client.EXE.
LOG: Attempting download of new URL file:///C:/Users/phill/source/repos/SignalRCoretest/SignalRCoretest/bin/Debug/Microsoft.AspNetCore.SignalR.Client.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Users\phill\source\repos\SignalRCoretest\SignalRCoretest\bin\Debug\Microsoft.AspNetCore.SignalR.Client.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Microsoft.AspNetCore.SignalR.Client, Version=3.1.20.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
LOG: Where-ref bind Codebase does not match what is found in default context. Keep the result in LoadFrom context.
LOG: Binding succeeds. Returns assembly from C:\Users\phill\source\repos\SignalRCoretest\SignalRCoretest\bin\Debug\Microsoft.AspNetCore.SignalR.Client.dll.
LOG: Assembly is loaded in LoadFrom load context.
0 Likes
Message 4 of 11

jeremy_tammik
Alumni
Alumni

Can you share a complete minimal reproducible case, please?

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 

Thank you!

 

Update: I see that you already did, in your DAS support case 18839576 [Fatal Revit crash when connecting to a .net Core SignalR Hub]. Thank you! I'll take a look and then get back to your here again, if that is OK.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 5 of 11

jeremy_tammik
Alumni
Alumni

I asked the development team for you.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 6 of 11

PhillipM
Advocate
Advocate

Thanks, Jeremy.

 

I would have supplied a sample here but the SignalR hub is slightly commercially sensitive at this stage.

 

CHeers

 

Phillip Miller

Message 7 of 11

jeremy_tammik
Alumni
Alumni

Yup, no problem, that's what I assumed.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 8 of 11

jeremy_tammik
Alumni
Alumni

Dear Phillip,

 

Thank you for your updates and sample material both here and in your DAS ticket 18839576 [Fatal Revit crash when connecting to a .net Core SignalR Hub].

 

I discussed the issue with the development team, and they would like to take a closer look at it. They suggest:

 

> I'm sure no one has tried this specific case.  If there's a CER provided with the crash getting the number would be helpful.  As would filing a PR on this.

 

Consequently, I submitted an internal development ticket REVIT-190073 [Fatal Revit crash connecting to a .NET Core SignalR Hub -- 18839576] for their further exploration. Please make a note of this number for future reference.

 

Can you provide the CER for them as well?

 

You are welcome to request an update on the status of this issue or to provide additional information on it at any time quoting this change request number.

 

This issue is important to me. What can I do to help?

 

This issue needs to be assessed by our engineering team and prioritised against all other outstanding change requests. Any information that you can provide to influence this assessment will help. Please provide the following where possible:

 

  • Impact on your application and/or your development.
  • The number of users affected.
  • The potential revenue impact to you.
  • The potential revenue impact to Autodesk.
  • Realistic timescale over which a fix would help you.
  • In the case of a request for a new feature or a feature enhancement, please also provide detailed Use cases for the workflows that this change would address.

 

This information is extremely important. Our engineering team have limited resources, and so must focus their efforts on the highest impact items. We do understand that this will cause you delays and affect your development planning, and we appreciate your cooperation and patience.

 

Best regards,

 

Jeremy

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 9 of 11

jeremy_tammik
Alumni
Alumni

Dear Phillip,

 

I heard back from the development on your ticket REVIT-190073 [Fatal Revit crash connecting to a .NET Core SignalR Hub -- 18839576]. They say:

 

I believe this is an assembly load problem caused by a package mismatch. When I try to reproduce the problem from scratch, there is no problem and I can successfully connect to a SignalR hub using ASP.NET Core. I tried this with both C# and VB and it works. I then tried Phillip's plugin and was able to reproduce the crash. So I think the problem is in Phillip's project setup. I noticed that he is explicitly installing all the NuGet packages that SignalR needs and I think the versions got messed up somehow. Can you ask Phillip to try these steps:

 

  • Exit Visual Studio
  • Uninstall all the NuGet packages form the project (quickest way is editing the {{packages.config}} file and deleting everything inside the {{<packages>}} node)
  • Delete the project's {{bin }}and {{obj }}folders
  • Delete contents of the project's {{packages}} folder
  • Open the project in Visual Studio
  • In NuGet package manager, install *only* {{Microsoft.AspNetCore.SignalR.Client}} package. This should pull all the other packages that SignalR needs with the correct versions
  • Rebuild the plugin
  • Run Revit with the new plugin and try connecting to the hub

 

This did the trick for me, hope it helps Phillip as well. Let me know the result.

 

I set this issue to "Need more information" state while waiting to hear back from the customer.

 

Best regards,

 

Jeremy

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 10 of 11

PhillipM
Advocate
Advocate

Hi Jermey.

 

Thanks for getting back to me.  This is fantastic news that it is doable.  Unfortunately, I'm still having issues.

 

I have followed the attached instructions on my test project and I still get Revit crashing.

 

https://www.screencast.com/t/dPgTUNL5suj 

 

I'm sure I'm missing something really simple but just can't see it 😞

 

Any further ideas?

 

Cheers

 

Phillip

 

0 Likes
Message 11 of 11

jeremy_tammik
Alumni
Alumni

I would suggest the following steps:

  

  • Discard your old project entirely.
  • Forget all about it.
  • Meditate in a cave.
  • Set up an entirely new SignalR project following the steps suggested by the devteam.
  • Verify that it works.
  • Very carefully, extract relevant fragments of your old project and implant them into the new.
  • Test.
  • Do not crash Revit.
  • Repeat with new miniscule fragment.

 

🙂

  

Good luck!

  

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