ASP.Net Core Error "Value cannot be null. Parameter name: factory"

Any solution to this? I am facing a similar issue with the same error message.