.net core 3 equivalnet configuration for adding xml serialization

Viewed 2345

what should be the equivalent setting for

services.AddMvc(options => { 
    options.RespectBrowserAcceptHeader = true; 
})
.AddXmlSerializerFormatters()
.AddXmlDataContractSerializerFormatters();

in asp.net core 3.0

Detail of the question can be seen at https://github.com/dotnet/corefx/issues/42085

1 Answers

It is found out to be

services.AddControllers(options => options.RespectBrowserAcceptHeader = true).AddXmlSerializerFormatters().AddXmlDataContractSerializerFormatters();
Related