I did this because the HubProxy is referencing the interface and needs to serialize to Json on line 153 in HubProxy.cs.
The JsonSerializer must be set when testing the HubProxy using a mocked up IConnection. Maybe it can be solved in another way.