check for PhysicalFileProvider - #47934
Conversation
* check that it is not a subclass of PhysicalFileProvider
|
Tagging subscribers to this area: @maryamariyan Issue Details
|
|
@stefannikolei thanks for the PR, could you also please add a test for this? |
There was a problem hiding this comment.
The PR change seems fine, @stefannikolei could you please also add a tests for this fix?
|
@mcm-ham (who reported the issue) if you have a small repro code that would help with preparing a test case here. |
| { | ||
| if (fileInfo.PhysicalPath != null) | ||
| if (fileInfo.PhysicalPath != null | ||
| && provider is PhysicalFileProvider && !provider.GetType().IsSubclassOf(typeof(PhysicalFileProvider))) |
There was a problem hiding this comment.
Couldn't this just be
| && provider is PhysicalFileProvider && !provider.GetType().IsSubclassOf(typeof(PhysicalFileProvider))) | |
| && provider?.GetType() == typeof(PhysicalFileProvider)) |
Also - would be great to add a comment here why we are doing this.
There was a problem hiding this comment.
Can we do this check once in the constructor
|
@stefannikolei thanks for your PR, do you plan on addressing the feedback and adding a test case for this? |
|
Closing this PR. @stefannikolei this is a good change, you could create a new PR if you plan on addressing the feedback |
fix Json Configuration custom IFileProvider stopped working for .NET 5.0 #47455