HTTP: Kestrel ve IIS BadHttpRequestException türleri eski olarak işaretlendi ve değiştirildi

Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException ve Microsoft.AspNetCore.Server.IIS.BadHttpRequestException eski olarak işaretlendi ve 'den Microsoft.AspNetCore.Http.BadHttpRequestExceptiontüreyen olarak değiştirildi. Kestrel ve IIS sunucuları yine de geriye dönük uyumluluk için eski özel durum türlerini oluşturur. Eski türler gelecek bir sürümde kaldırılacaktır.

Tartışma için bkz . dotnet/aspnetcore#20614.

Sürüm kullanıma sunulmuştur

5.0 Önizleme 4

Eski davranış

Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException ve Microsoft.AspNetCore.Server.IIS.BadHttpRequestException kaynaklarından System.IO.IOExceptiontüretilir.

Yeni davranış

Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException ve Microsoft.AspNetCore.Server.IIS.BadHttpRequestException artık kullanılmıyor. Türler, türünden Microsoft.AspNetCore.Http.BadHttpRequestExceptionde türetilir System.IO.IOException.

Değişiklik nedeni

Değişiklik şu şekilde yapılmıştır:

  • Yinelenen türleri birleştirin.
  • Sunucu uygulamaları genelinde davranışı birleştirme.

Bir uygulama artık Kestrel veya IIS kullanırken temel özel durumu Microsoft.AspNetCore.Http.BadHttpRequestException yakalayabilir.

ve Microsoft.AspNetCore.Server.IIS.BadHttpRequestException kullanımlarını Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException ile Microsoft.AspNetCore.Http.BadHttpRequestExceptiondeğiştirin.

Etkilenen API’ler