For others who came to this page, I had the same problem, but the solution was much simpler. As mentioned in the comments above, the accepted answer is bad. It is also mentioned that SignalR uses MachineKeyDataProtector for IProtectedData by default. MapHubs and MapConnection both calls to the InitializeProtectedData function, which registers MachineKeyDataProtector with a dependency MapConnection .
My problem was that I mapped SignalR routes, and THEN set up the dependency ID
RouteTable.Routes.MapConnection<SomeEndpoint>("SomeEndpoint", "SomeEndpointUrl"); GlobalHost.DependencyResolver = new StructureMapDependencyResolver(ObjectFactory.Container);
So basically the IProtectedData recognizer registration done by MapConnection -> InitializeProtectedData went astray when I registered my custom resolver. A simple fix, install the converter BEFORE displaying the connection.
GlobalHost.DependencyResolver = new StructureMapDependencyResolver(ObjectFactory.Container); RouteTable.Routes.MapConnection<SomeEndpoint>("SomeEndpoint", "SomeEndpointUrl");
source share