Skip to content
Documentation

WebApplicationBuilderExtensions Class

Adds services for error handling to a web application.

public static class WebApplicationBuilderExtensions

Inheritance System.Object 🡒 WebApplicationBuilderExtensions

WebApplicationBuilderExtensions.AddHakomErrorHandling(this WebApplicationBuilder) Method

Section titled “WebApplicationBuilderExtensions.AddHakomErrorHandling(this WebApplicationBuilder) Method”

Adds output of Microsoft.AspNetCore.Mvc.ProblemDetails to the application.

This must be added after calling .AddMvc/.AddControllers, because the MVC framework adds additional services which have to be removed for consistent serialization of problem details across the application.

For this to work properly, it requires that serialization is set up, so make sure to add the respective services. Example:

builder.Services.AddHakomServices(container=>{
container
.UseSerializerFactory()
.UseSerializationContractTypeProvider()
.UseJsonSerialization()
.UseDefaultJsonSerializer()
.UseResultJsonSerialization();
});
public static Microsoft.AspNetCore.Builder.WebApplicationBuilder AddHakomErrorHandling(this Microsoft.AspNetCore.Builder.WebApplicationBuilder builder);

builder Microsoft.AspNetCore.Builder.WebApplicationBuilder

The Microsoft.AspNetCore.Builder.WebApplicationBuilder to add error handling capabilities to.

Microsoft.AspNetCore.Builder.WebApplicationBuilder
The builder for chaining additional calls to it.

© 2026 Volue.Version v0.6.38017 November 2026