0

One of my our application uses System.Web.Http to support ExceptionHandler in ASP.NET 4.x for the existing code. Currently I am migrating all the class library to .Net 6 Class library. However, System.Web.Http nuget package is not available for .NET 6.

Is there any alternative package to support ExceptionHandler in .NET 6?

Tried many NuGet package packages. Didn't work out.

Jackdaw
  • 7,626
  • 5
  • 15
  • 33

1 Answers1

1

The System.Web.Http namespace does not exist in the .Net Core 6. See the documentation: Migrate from ASP.NET Web API to ASP.NET

To migrate to ASP.NET Core:

Remove using statements for the following ASP.NET 4.x components that don't exist in ASP.NET Core:

  • ApiController class
  • System.Web.Http namespace
  • IHttpActionResult interface

How to process error exceptions in ASP.NET Core this will depend on your specific case. For more details you can reference to the following article in the Microsoft documentation: Handle errors in ASP.NET Core


For example, see the solution provided in the following post: After upgrading to .Net 6, system.web no longer contains HttpException

Jackdaw
  • 7,626
  • 5
  • 15
  • 33