Closed brian-imaginelearning closed 4 years ago
Thanks, this is related to using IOptionsSnapshot<T>
in ZLoggerProvider's constructor.
In development mode, defaultbuilder validate scope but currently ZLogger does not use scope.
https://github.com/dotnet/runtime/blob/d09c058e4b7a23f00f033f35ae60bc06f71f2bcf/src/libraries/Microsoft.Extensions.Hosting/src/Host.cs#L121-L123
I've changed to use IOptionsMonitor<T>
, it works fine, so now released 1.2.0
, please try it.
Works great. Thanks!
When DOTNET_ENVIRONMENT is set to "Development", an exception is thrown during configuration:
System.InvalidOperationException: Cannot resolve scoped service 'Microsoft.Extensions.Options.IOptionsSnapshot`1[ZLogger.ZLoggerOptions]' from root provider.
Simple app to reproduce: (using netcoreapp3.1 and ZLogger v1.1.11)