You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of performance improvements made to ASP.NET Core 3.0 (dotnet/aspnetcore#6504), we've removed the extensibility of DefaultHttpContext (it is now sealed). This extensibility was provided initially to allow pooling of the HttpContext but it introduced more complexity than necessary and precluded other optimizations. As a result, we decided to remove this extensibility.
If you're using Mock<DefaultHttpContext> in your unit tests, we recommend using Mock<HttpContext> instead.
Removed extensibility for DefaultHttpContext
As part of performance improvements made to ASP.NET Core 3.0 (dotnet/aspnetcore#6504), we've removed the extensibility of DefaultHttpContext (it is now sealed). This extensibility was provided initially to allow pooling of the HttpContext but it introduced more complexity than necessary and precluded other optimizations. As a result, we decided to remove this extensibility.
If you're using
Mock<DefaultHttpContext>
in your unit tests, we recommend usingMock<HttpContext>
instead.Please discuss this on dotnet/aspnetcore#6534
Version introduced
3.0
Old behavior
DefaultHttpContext could be inherited from.
New behavior
DefaultHttpContext is sealed.
Reason for change
Extensibility introduced more complexity than necessary and precluded other optimizations. As a result, we decided to remove this extensibility.
Recommended action
If you're using
Mock<DefaultHttpContext>
in your unit tests, we recommend usingMock<HttpContext>
instead.Category
Affected APIs
DefaultHttpContext
Issue metadata
The text was updated successfully, but these errors were encountered: