Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.net core 3 equivalnet configuration for adding xml serialization

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

like image 865
Kamran Shahid Avatar asked Feb 17 '26 18:02

Kamran Shahid


1 Answers

It is found out to be

services.AddControllers(options => options.RespectBrowserAcceptHeader = true).AddXmlSerializerFormatters().AddXmlDataContractSerializerFormatters();
like image 81
Kamran Shahid Avatar answered Feb 19 '26 09:02

Kamran Shahid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!