-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to cleanup Configuration related disposables #3564
Comments
update: even after disposing the file providers like above im still having this: Not Flagged 28660 8 Worker Thread Worker Thread Microsoft.Extensions.Configuration.FileExtensions.dll!Microsoft.Extensions.Configuration.FileConfigurationProvider..ctor.AnonymousMethod__0_1 |
@JanEggers I think ideally a unit test wouldn't use the "real" configuration and would just use the in-memory configuration provider, thus avoiding all external resources (and thus no file system watchers). Another option would be for the unit test to just avoid using the Are these options in your scenario? |
This issue was moved to aspnet/Configuration#882 |
Im having issues in a Unittests that complains that not all threads are ended when the unittest is completed.
Turns out this is due to using this:
the reloadable json file generates Filewatchers that hang in a sleep if the test is ended.
the core problem is that there PhsicalFileProvider is disposable but currently I have to do something like this to clean it up:
I see two options here to improve the situation:
make IConfigurationRoot and all related classes disposable so I can just call config.Dispose();
resolve providers from DI so DI takes care of disposing the resources that require to do so.
maybe related to #3110
The text was updated successfully, but these errors were encountered: