I am having exact same problem and I am unable to resolve it using mentioned fix.
I am using RMMS Modbus TCP simulator,
this is show in the http://localhost:8180/RemoteConsole.cshtml
I am using V 2.5.6
[TEST_MOD_TCP] Attempting connection…
[TEST_MOD_TCP] Connection attempt failed: Object reference not set to an instance of an object.
[TEST_MOD_TCP] Device disconnected.