Skip to content

[Signalr-Cpp-Client] Cannot use start method using DLL with static linking #60309

Open
@cmd270

Description

@cmd270

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When calling the start method on hub_connection I catch an exception through a callback function with the following content: set_fail_handler: 2: Underlying Transport Error. As I understand it, this is most likely related to the fact that I am using a DLL file with statically linked vcpkg packages for microsoft-signalr.

A more detailed log with trace level set to verbose:

2025-02-11T07:24:53.687Z [verbose  ] acquired lock in start()
2025-02-11T07:24:53.687Z [verbose  ] disconnected -> connecting
2025-02-11T07:24:53.687Z [verbose  ] released lock in start()
2025-02-11T07:24:55.754Z [info     ] [websocket transport] connecting to: ws://localhost:5122/scale?id=qZR34PjhRw1uoHHASgML5w
2025-02-11T07:24:55.758Z [error    ] [websocket transport] exception when connecting to the server: set_fail_handler: 2: Underlying Transport Error
2025-02-11T07:24:55.759Z [error    ] transport could not connect due to: set_fail_handler: 2: Underlying Transport Error
2025-02-11T07:24:55.759Z [error    ] connection could not be started due to: set_fail_handler: 2: Underlying Transport Error
2025-02-11T07:24:55.759Z [verbose  ] connecting -> disconnected

Notably, the server logs where the client connects indicate that a new connection was created:

[15:24:55 DBG] 1 candidate(s) found for the request path '/scale/negotiate'
[15:24:55 DBG] Request matched endpoint '/scale/negotiate'
[15:24:55 DBG] Static files was skipped as the request already matched an endpoint.
[15:24:55 INF] Executing endpoint '/scale/negotiate'
[15:24:55 DBG] New connection Ri7NYPIjmMPqdUT_UoRggg created.
[15:24:55 DBG] Sending negotiation response.
[15:24:55 INF] Executed endpoint '/scale/negotiate'
[15:24:55 INF] Request finished HTTP/1.1 POST http://localhost:5122/scale/negotiate?negotiateVersion=1 - 200 316 application/json 5.7812ms

I created a test client using an executable, and there the connection, message sending, and receiving work perfectly.

Expected Behavior

After using start method hub_connection state would be changed from signalr::connection_state::disconnected to signalr::connection_state::connected.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-signalrIncludes: SignalR clients and servers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions