c# - .net core 3 equivalnet 配置添加 xml 序列化

标签 c# .net-core-3.0 asp.net-core-3.0

什么应该是

的等效设置
services.AddMvc(options => { 
    options.RespectBrowserAcceptHeader = true; 
})
.AddXmlSerializerFormatters()
.AddXmlDataContractSerializerFormatters();

在 ASP.NET Core 3.0 中

问题详情可见https://github.com/dotnet/corefx/issues/42085

最佳答案

发现是

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

关于c# - .net core 3 equivalnet 配置添加 xml 序列化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58543659/

相关文章:

c# - 在 .NET/C# 上下文中,什么是二分搜索以及如何/为什么使用二分搜索?

c# - 创建一个 List<Book> c# 控制台应用程序

c# - 如何模拟 Microsoft.Deployment.WindowsInstaller session

c# - 使用 .NET core 3.0/System.text.Json 解析 JSON 文件

.net-core - 无法访问 .net Core 3 中的 resx 文件

c# - Entity Framework 中与表名连接的垃圾值

.net - 使用 Microsoft.Extensions.Hosting.WindowsServices 时无法启动 Windows 服务

asp.net-core-3.0 - 在 .Net core 3.0 控制台应用程序中使用 HttpClient 上传文件

mysql - 使用 EFcore 3.0 配置 MySQL

c# - NU1107 : . Microsoft.EntityFrameworkCore.SqlServer 的 Net Core 2.1 兼容替代品?