Conversation
|
|
||
| <Reference Include="Microsoft.Extensions.Configuration.Binder" /> | ||
| <Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions" /> | ||
| <Reference Include="Microsoft.Extensions.DependencyInjection" /> |
There was a problem hiding this comment.
This is slightly unfortunate. But not the end of the world I guess.
| public bool ShouldDispose; | ||
| } | ||
|
|
||
| private class DisposingLoggerFactory: ILoggerFactory |
There was a problem hiding this comment.
The fact that we need to hold onto the container means all of the sample code is sorta busted
There was a problem hiding this comment.
Maybe you’re saying we don’t need to dispose the service provider?
There was a problem hiding this comment.
Why does this wrapper exist to begin with?
There was a problem hiding this comment.
To dispose ILoggerProviders created by DI
There was a problem hiding this comment.
Doesn’t disposing the factory do that?
There was a problem hiding this comment.
Ah, I see it wouldn’t. That makes the current usage without this API leaky.
There was a problem hiding this comment.
If you don't dispose the service provider - yes.
There was a problem hiding this comment.
I’m taking about examples that you would use today (even in our samples)
|
|
||
| <Reference Include="Microsoft.Extensions.Configuration.Binder" /> | ||
| <Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions" /> | ||
| <Reference Include="Microsoft.Extensions.DependencyInjection" /> |
There was a problem hiding this comment.
It seems that this change caused these failures in my PR build. It actually showed up in your PR check too, but as a warning instead of an error.
@natemcmaster 1. Is the proper solution here (assuming it is an approved breaking change) to edit this line? 2. Should this kind of change be a warning or an error?
There was a problem hiding this comment.
@ryanbrandenburg does your PR invoke build with --warnaserror?
There was a problem hiding this comment.
Yes, that's what Arcade defaults to. We can certainly override that anywhere (or everywhere), but I thought I'd ask since this seems like the kind of thing we might want to fail a build (even if it's just so we can document that this was an intended break).
Commit migrated from dotnet/extensions@1414cac
Commit migrated from dotnet/extensions@1414cac
Commit migrated from dotnet/extensions@1414cac
Commit migrated from dotnet/extensions@1414cac
Adds the
LoggerFactory.Createthat simplifies LoggerFactory creation in cases where dependency injection is not used in the application.So the pattern becomes:
Fixes: #615