I would like to know if it is possible to implement Microsofts Signalr library in a protocol solution. Signalr is a .NET library that allows for real-time updates from the server to the client and is made for ASP.NET (more information here). I am able to download the NuGet packages required, but I run into an issue where I am getting a 'TargetInvocationException' when running the code. I am not sure if this exception is happening because Signalr is meant for the ASP.NET framework or because there is a reference that I might not be aware of. Any help is appreciated. I have added a screenshot for reference.
Here is the exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Method 'DisposeAsync' in type 'Microsoft.AspNetCore.SignalR.Client.HubConnection' from assembly 'Microsoft.AspNetCore.SignalR.Client.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.
at QAction.Run(SLProtocol protocol)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at CManagedScript.Run(CManagedScript* , Int32 iDmaId, Int32 iEid, Int32 trigger, Int32 iCookie, IUnknown* pILog, IUnknown* pProtocol, tagVARIANT* varParameters, tagVARIANT* varRowInfo, tagVARIANT* pvarReturn)
Hi Julian,
Not sure whether you are having issues still. In any case, I've played with SignalR in the past and this was more or less the code used. Please note that this code was developed only to play around and that improvements are needed before putting anything into production.
DLL used:Microsoft.AspNet.SignalR.Client.dll
Kind regards,
Hi Julian,
which version are you using of the NuGet?
Internal testing pointed out that some versions gave exceptions, but no further investigation happened. If this implementation is important i would indeed chase this further with internal experts.
Something that I just noticed is that we are using different libraries. Is it indeed the Core one that you need?