diff --git a/src/Microsoft.AspNetCore.Http.Connections.Client/HttpConnection.cs b/src/Microsoft.AspNetCore.Http.Connections.Client/HttpConnection.cs
index 74e8577c94..176554485f 100644
--- a/src/Microsoft.AspNetCore.Http.Connections.Client/HttpConnection.cs
+++ b/src/Microsoft.AspNetCore.Http.Connections.Client/HttpConnection.cs
@@ -68,8 +68,19 @@ namespace Microsoft.AspNetCore.Http.Connections.Client
///
public override IFeatureCollection Features { get; } = new FeatureCollection();
- ///
- public override string ConnectionId { get; set; }
+ ///
+ /// Gets or sets the connection ID.
+ ///
+ ///
+ /// The connection ID is set when the is started and should not be set by user code.
+ /// If the connection was created with set to true
+ /// then the connection ID will be null.
+ ///
+ public override string ConnectionId
+ {
+ get => _connectionId;
+ set => throw new InvalidOperationException("The ConnectionId is set internally and should not be set by user code.");
+ }
///
public override IDictionary