I receive following exception when I try to use custom DbContext in Configure method in Startup.cs file. I use ASP.NET Core in version 2.0.0-previe
In ASP.NET Core 2.0 and newer you can simply inject the scoped service you need into the Configure constructor, like you tried to do initially:
public void Configure(
IApplicationBuilder app,
IHostingEnvironment env,
ILoggerFactory loggerFactory,
CommunicatorContext dbContext,
ILdapService ldapService)
{
// ...
}
This is a lot easier, thanks to the improvements in #1106.