# Microsoft.AspNetCore.SignalR.HubException: Failed to negotiate with the server. The server returned an unsupported negotiate version.

- **ID:** `dotnet/signalr-negotiate-version`
- **Domain:** dotnet
- **Category:** protocol_error
- **Verification:** ai_generated
- **Fix Rate:** 88%

## Root Cause

SignalR client and server negotiate connection parameters; an unsupported negotiate version error occurs when the client uses an outdated or incompatible SignalR protocol version that the server does not recognize.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| .NET 6.0 | active | — | — |
| .NET 7.0 | active | — | — |
| .NET 8.0 | active | — | — |
| Microsoft.AspNetCore.SignalR.Client 6.0 | active | — | — |
| Microsoft.AspNetCore.SignalR.Client 7.0 | active | — | — |
| Microsoft.AspNetCore.SignalR.Client 8.0 | active | — | — |

## Workarounds

1. **Ensure both client and server use the same major version of Microsoft.AspNetCore.SignalR (e.g., both 6.0.x or both 8.0.x). Check .csproj files and server packages.** (90% success)
   ```
   Ensure both client and server use the same major version of Microsoft.AspNetCore.SignalR (e.g., both 6.0.x or both 8.0.x). Check .csproj files and server packages.
   ```
2. **If using a custom negotiation endpoint, update it to return the correct negotiate response with protocol version 1 or higher.** (85% success)
   ```
   If using a custom negotiation endpoint, update it to return the correct negotiate response with protocol version 1 or higher.
   ```
3. **Downgrade the client package to match the server version: dotnet add package Microsoft.AspNetCore.SignalR.Client --version 6.0.25** (88% success)
   ```
   Downgrade the client package to match the server version: dotnet add package Microsoft.AspNetCore.SignalR.Client --version 6.0.25
   ```

## Dead Ends

- **Set HubConnectionBuilder to use raw WebSockets without negotiation** — Disabling negotiation may bypass version check but causes connection failures if the server requires negotiation for transports like Server-Sent Events. (80% fail)
- **Upgrade only the client-side SignalR package to the latest version** — If the server is an older version, the latest client may introduce a negotiate version the server doesn't support; both sides must be compatible. (65% fail)
- **Ignore the error and retry connection with exponential backoff** — Retrying does not fix the protocol version mismatch; the negotiate request will fail repeatedly. (95% fail)
