如果在 Startup.ConfigureServices 中使用 services.AddMvcCore() ,访问时会出现下面的错误:
'Microsoft.AspNetCore.Mvc.MvcOptions.InputFormatters' must not be empty. At least one 'Microsoft.AspNetCore.Mvc.Formatters.IInputFormatter' is required to bind from the body.
at Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinderProvider.GetBinder(ModelBinderProviderContext context)
请问如何解决?
相关问题
- ASP.NET Core ConfigureServices 中从 appsettings.json
- .Net5 强制https请求重复跳转问题
- WPF中click事件无效怎么解决
- memory leak Microsoft.Extensions.Logging asp.net c
- Skip()函数和Take()函数不起作用
看了一下AddMvc的源码,我觉得你应该还要加上一些初始化的东西