.Net Core 2.1 - Cannot access a disposed object.Object name: 'IServiceProvider'

前端 未结 5 1207
甜味超标
甜味超标 2020-12-10 01:38

I just migrated .NET Core 2.0 to .NET Core 2.1. Everything went fine, but when I try to login now I get the folowing error:

  • $exception {Syste
5条回答
  •  渐次进展
    2020-12-10 01:44

    I would imagine that the IServiceProvider implementation may have been used in a using statement inadvertently somewhere or been disposed outright.

    To test if this is the case you could try to resolve the IHttpContextAccessor right after, or in, the ConfigureServices method.

    If it resolves there you would need to step through to find out where the IServiceProvider is being disposed.

提交回复
热议问题