question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrade to 4.0.2 breaks SignalR

See original GitHub issue

When upgrading from version LightInject 4.0.0 to 4.0.2 using LightInject.SignalR integration I get the following exception:

Exception of type System.Reflection.TargetInvocationException
Source: mscorlib
Message: Exception has been thrown by the target of an invocation.
   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 Owin.Loader.DefaultLoader.<>c__DisplayClass12.<MakeDelegate>b__b(IAppBuilder builder)
   at Owin.Loader.DefaultLoader.<>c__DisplayClass1.<LoadImplementation>b__0(IAppBuilder builder)
   at Microsoft.Owin.Hosting.Engine.HostingEngine.ResolveApp(StartContext context)
   at Microsoft.Owin.Hosting.Engine.HostingEngine.Start(StartContext context)
   at Microsoft.Owin.Hosting.Starter.DirectHostingStarter.Start(StartOptions options)
   at Microsoft.Owin.Hosting.Starter.HostingStarter.Start(StartOptions options)
   at Microsoft.Owin.Hosting.WebApp.StartImplementation(IServiceProvider services, StartOptions options)
   at Microsoft.Owin.Hosting.WebApp.Start(StartOptions options)
   at Microsoft.Owin.Hosting.WebApp.Start[TStartup](StartOptions options)
   at Server.StartServiceWebApp() in M:\Projects\Server\Server.cs:line 187

Inner Exception of type System.MissingMethodException
Source: LightInject.SignalR
Message: Method not found: 'Void LightInject.IServiceRegistry.Register(System.Linq.Expressions.Expression`1<System.Func`2<LightInject.IServiceFactory,!!0>>)'.
   at LightInject.SignalR.LightInjectDependencyResolver..ctor(IServiceContainer serviceContainer)
   at Server.Startup.Configuration(IAppBuilder app) in M:\Projects\Server\Startup.cs:line 31

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
seesharpercommented, Aug 26, 2016

I will move SignalR into its own repo and add specific support for Net46

0reactions
geirsagbergcommented, Aug 23, 2016

I had to workaround this issue by not using LightInject.SignalR, but manually registering my hub with the SignalR dependency resolver:

var hubConfiguration = new HubConfiguration();
hubConfiguration.Resolver.Register(typeof(MyHub), Container.Create<MyHub>());
app.MapSignalR(hubConfiguration);

This enables constructor injection in the hub, using services already registered in the LightInject Container.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrade SignalR to SignalR 2
My application is using ASP.NET MVC 5. I upgraded SignalR to SignalR 2; getting the user list does not work after the upgrade....
Read more >
ASP.NET SignalR Hubs API Guide - Server (C#)
The OnReconnected method is called when there has been a temporary break in connectivity that SignalR can automatically recover from, such as ...
Read more >
Adventures of upgrading SignalR 1.x to 2.x
Using NuGet, I fetched Microsoft.AspNet.Identity.Owin and fixed the missing references. Broken Code. After the app compiled, ran it for ...
Read more >
Upgrading SignalR 1.x Projects to version 2
This topic describes how to upgrade an existing SignalR 1.x project to SignalR 2.x, and how to troubleshoot issues that may arise during...
Read more >
Security with ASP.NET Core, SignalR and Angular
2020-07-06 Updated to IdentityServer4 4.0.2, angular-auth-oidc-client 11.1.4 ... 2020-06-28 Updated IdentityServer4 V4 + breaking changes and nuget packages.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found