aspnetcore/breaking-changes/5/http-badhttprequestexception-obsolete.md
Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException and Microsoft.AspNetCore.Server.IIS.BadHttpRequestException have been marked obsolete and changed to derive from Microsoft.AspNetCore.Http.BadHttpRequestException. The Kestrel and IIS servers still throw their old exception types for backwards compatibility. The obsolete types will be removed in a future release.
For discussion, see dotnet/aspnetcore#20614.
5.0 Preview 4
Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException and Microsoft.AspNetCore.Server.IIS.BadHttpRequestException derived from xref:System.IO.IOException?displayProperty=nameWithType.
Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException and Microsoft.AspNetCore.Server.IIS.BadHttpRequestException are obsolete. The types also derive from Microsoft.AspNetCore.Http.BadHttpRequestException, which derives from System.IO.IOException.
The change was made to:
An app can now catch the base exception Microsoft.AspNetCore.Http.BadHttpRequestException when using either Kestrel or IIS.
Replace usages of Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException and Microsoft.AspNetCore.Server.IIS.BadHttpRequestException with Microsoft.AspNetCore.Http.BadHttpRequestException.