From 4af9619716ae2d7b8be4d109dbd6ab845607f641 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Mar 2026 14:25:33 +0000 Subject: [PATCH 1/6] Initial plan From f548e0cb00c29ed4f55206c2162e01e88d528c54 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Mar 2026 14:45:55 +0000 Subject: [PATCH 2/6] Improve XML documentation across FileProviders libraries Co-authored-by: svick <287848+svick@users.noreply.github.com> --- .../src/NotFoundDirectoryContents.cs | 5 ++++ .../src/NotFoundFileInfo.cs | 2 +- .../src/NullChangeToken.cs | 4 ++-- .../src/NullFileProvider.cs | 5 ++++ .../src/CompositeDirectoryContents.cs | 2 +- .../src/Internal/PhysicalDirectoryContents.cs | 6 ++--- .../src/PhysicalDirectoryInfo.cs | 2 +- .../src/PhysicalFileInfo.cs | 2 +- .../src/PhysicalFileProvider.cs | 8 +++---- .../src/PhysicalFilesWatcher.cs | 24 +++++++++---------- .../src/PollingFileChangeToken.cs | 8 +++---- .../src/PollingWildCardChangeToken.cs | 2 +- 12 files changed, 40 insertions(+), 30 deletions(-) diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NotFoundDirectoryContents.cs b/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NotFoundDirectoryContents.cs index 8b3110dd401dd3..410f0de4eaa39d 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NotFoundDirectoryContents.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NotFoundDirectoryContents.cs @@ -12,6 +12,11 @@ namespace Microsoft.Extensions.FileProviders /// public class NotFoundDirectoryContents : IDirectoryContents { + /// + /// Initializes a new instance of the class. + /// + public NotFoundDirectoryContents() { } + /// /// Gets a shared instance of . /// diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NotFoundFileInfo.cs b/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NotFoundFileInfo.cs index 74cff98b1b14e0..ab1e79b8f95ba4 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NotFoundFileInfo.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NotFoundFileInfo.cs @@ -13,7 +13,7 @@ namespace Microsoft.Extensions.FileProviders public class NotFoundFileInfo : IFileInfo { /// - /// Initializes an instance of . + /// Initializes a new instance of the class. /// /// The name of the file that could not be found. public NotFoundFileInfo(string name) diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NullChangeToken.cs b/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NullChangeToken.cs index eb10eed91052a2..eb22a18131bc6f 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NullChangeToken.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NullChangeToken.cs @@ -33,8 +33,8 @@ private NullChangeToken() /// /// Always returns an empty disposable object. Callbacks will never be called. /// - /// This parameter is ignored. - /// This parameter is ignored. + /// The callback. This parameter is ignored. + /// The state. This parameter is ignored. /// A disposable object that no-ops on dispose. public IDisposable RegisterChangeCallback(Action callback, object? state) { diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NullFileProvider.cs b/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NullFileProvider.cs index 210ba67a140aa8..6a8eab52e440d1 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NullFileProvider.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NullFileProvider.cs @@ -10,6 +10,11 @@ namespace Microsoft.Extensions.FileProviders /// public class NullFileProvider : IFileProvider { + /// + /// Initializes a new instance of the class. + /// + public NullFileProvider() { } + /// /// Enumerates a nonexistent directory. /// diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Composite/src/CompositeDirectoryContents.cs b/src/libraries/Microsoft.Extensions.FileProviders.Composite/src/CompositeDirectoryContents.cs index 7e66dc12d8d662..ce88caa1a79def 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Composite/src/CompositeDirectoryContents.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Composite/src/CompositeDirectoryContents.cs @@ -21,7 +21,7 @@ public class CompositeDirectoryContents : IDirectoryContents private List? _directories; /// - /// Creates a new instance of to represents the result of a call composition of + /// Initializes a new instance of the class to represent the result of a call composition of /// . /// /// The list of for which the results have to be composed. diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Internal/PhysicalDirectoryContents.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Internal/PhysicalDirectoryContents.cs index b8bb67eb4fa05c..42ebbe2abe66fd 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Internal/PhysicalDirectoryContents.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Internal/PhysicalDirectoryContents.cs @@ -17,7 +17,7 @@ public class PhysicalDirectoryContents : IDirectoryContents private readonly PhysicalDirectoryInfo _info; /// - /// Initializes an instance of . + /// Initializes a new instance of the class. /// /// The directory to represent. public PhysicalDirectoryContents(string directory) @@ -25,10 +25,10 @@ public PhysicalDirectoryContents(string directory) { } /// - /// Initializes an instance of . + /// Initializes a new instance of the class. /// /// The directory to represent. - /// Specifies which files or directories are excluded from enumeration. + /// A bitwise combination of the enumeration values that specifies which files or directories are excluded from enumeration. public PhysicalDirectoryContents(string directory, ExclusionFilters filters) { ArgumentNullException.ThrowIfNull(directory); diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalDirectoryInfo.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalDirectoryInfo.cs index ec1404564527fb..42e383ee63af78 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalDirectoryInfo.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalDirectoryInfo.cs @@ -20,7 +20,7 @@ public class PhysicalDirectoryInfo : IFileInfo, IDirectoryContents private readonly ExclusionFilters _filters; /// - /// Initializes an instance of that wraps an instance of . + /// Initializes a new instance of the class that wraps an instance of . /// /// The directory to represent. public PhysicalDirectoryInfo(DirectoryInfo info) diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFileInfo.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFileInfo.cs index ea70848d06fb3a..7a61206c00c0e9 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFileInfo.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFileInfo.cs @@ -14,7 +14,7 @@ public class PhysicalFileInfo : IFileInfo private readonly FileInfo _info; /// - /// Initializes an instance of that wraps an instance of . + /// Initializes a new instance of the class that wraps an instance of . /// /// The . public PhysicalFileInfo(FileInfo info) diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFileProvider.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFileProvider.cs index b9faf2ac1a9071..ede1b40f391a23 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFileProvider.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFileProvider.cs @@ -38,7 +38,7 @@ public class PhysicalFileProvider : IFileProvider, IDisposable private bool _disposed; /// - /// Initializes a new instance of a PhysicalFileProvider at the given root directory. + /// Initializes a new instance of the class at the given root directory. /// /// The root directory. This should be an absolute path. public PhysicalFileProvider(string root) @@ -47,10 +47,10 @@ public PhysicalFileProvider(string root) } /// - /// Initializes a new instance of a PhysicalFileProvider at the given root directory. + /// Initializes a new instance of the class at the given root directory. /// /// The root directory. This should be an absolute path. - /// Specifies which files or directories are excluded. + /// A bitwise combination of the enumeration values that specifies which files or directories are excluded. public PhysicalFileProvider(string root, ExclusionFilters filters) { if (!Path.IsPathRooted(root)) @@ -207,7 +207,7 @@ public void Dispose() /// /// Disposes the provider. /// - /// true is invoked from . + /// if invoked from ; otherwise, . protected virtual void Dispose(bool disposing) { if (!_disposed) diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFilesWatcher.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFilesWatcher.cs index c296bfabad95f7..64531c2eb7a0a8 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFilesWatcher.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFilesWatcher.cs @@ -41,14 +41,14 @@ public class PhysicalFilesWatcher : IDisposable private bool _disposed; /// - /// Initializes an instance of that watches files in . - /// Wraps an instance of . + /// Initializes a new instance of the class that watches files in . + /// Wraps an instance of . /// - /// Root directory for the watcher. - /// The wrapped watcher that's watching . + /// The root directory for the watcher. + /// The wrapped watcher that's watching . /// /// for the poller to use polling to trigger instances of - /// created by . + /// created by ; otherwise, . /// public PhysicalFilesWatcher( string root, @@ -59,16 +59,16 @@ public PhysicalFilesWatcher( } /// - /// Initializes an instance of that watches files in . - /// Wraps an instance of . + /// Initializes a new instance of the class that watches files in . + /// Wraps an instance of . /// - /// Root directory for the watcher. - /// The wrapped watcher that is watching . + /// The root directory for the watcher. + /// The wrapped watcher that is watching . /// /// for the poller to use polling to trigger instances of - /// created by . + /// created by ; otherwise, . /// - /// Specifies which files or directories are excluded. Notifications of changes to are not raised to these. + /// A bitwise combination of the enumeration values that specifies which files or directories are excluded. Notifications of changes to these are not raised. public PhysicalFilesWatcher( string root, FileSystemWatcher? fileSystemWatcher, @@ -247,7 +247,7 @@ public void Dispose() /// /// Disposes the provider. /// - /// true is invoked from . + /// if invoked from ; otherwise, . protected virtual void Dispose(bool disposing) { if (!_disposed) diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingFileChangeToken.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingFileChangeToken.cs index 0d6d020f4952f9..6f99f549c1a483 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingFileChangeToken.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingFileChangeToken.cs @@ -28,8 +28,8 @@ public class PollingFileChangeToken : IPollingChangeToken private CancellationChangeToken? _changeToken; /// - /// Initializes a new instance of that polls the specified file for changes as - /// determined by . + /// Initializes a new instance of the class that polls the specified file for changes as + /// determined by . /// /// The to poll. public PollingFileChangeToken(FileInfo fileInfo) @@ -110,8 +110,8 @@ public bool HasChanged /// /// Does not actually register callbacks. /// - /// This parameter is ignored. - /// This parameter is ignored. + /// The callback to invoke. This parameter is ignored when is . + /// The state to pass to . This parameter is ignored when is . /// A disposable object that no-ops when disposed. public IDisposable RegisterChangeCallback(Action callback, object? state) { diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingWildCardChangeToken.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingWildCardChangeToken.cs index 78f40d08a21a8b..63f768d89313a4 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingWildCardChangeToken.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingWildCardChangeToken.cs @@ -34,7 +34,7 @@ public class PollingWildCardChangeToken : IPollingChangeToken private CancellationChangeToken? _changeToken; /// - /// Initializes a new instance of . + /// Initializes a new instance of the class. /// /// The root of the file system. /// The pattern to watch. From b044d7d52958d625b0a4fe9b7c6979134c150005 Mon Sep 17 00:00:00 2001 From: Petr Onderka Date: Wed, 11 Mar 2026 15:58:22 +0100 Subject: [PATCH 3/6] Revert unnecessary change --- .../src/NullChangeToken.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NullChangeToken.cs b/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NullChangeToken.cs index eb22a18131bc6f..eb10eed91052a2 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NullChangeToken.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/NullChangeToken.cs @@ -33,8 +33,8 @@ private NullChangeToken() /// /// Always returns an empty disposable object. Callbacks will never be called. /// - /// The callback. This parameter is ignored. - /// The state. This parameter is ignored. + /// This parameter is ignored. + /// This parameter is ignored. /// A disposable object that no-ops on dispose. public IDisposable RegisterChangeCallback(Action callback, object? state) { From ff9df5d3d964593355c32af3643b70274edf76d7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Mar 2026 15:43:15 +0000 Subject: [PATCH 4/6] Fix inaccurate XML doc summary on PollingFileChangeToken.RegisterChangeCallback Co-authored-by: svick <287848+svick@users.noreply.github.com> --- .../src/PollingFileChangeToken.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingFileChangeToken.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingFileChangeToken.cs index 6f99f549c1a483..2cf9207f726f96 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingFileChangeToken.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingFileChangeToken.cs @@ -108,7 +108,8 @@ public bool HasChanged } /// - /// Does not actually register callbacks. + /// Registers a callback that will be invoked when the token changes, if is . + /// If is , no callback is registered and an empty disposable is returned. /// /// The callback to invoke. This parameter is ignored when is . /// The state to pass to . This parameter is ignored when is . From cf3c65d20a0d266f0a4f49447bdd36cd2a8bb752 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Mar 2026 10:59:46 +0000 Subject: [PATCH 5/6] Fix inaccurate ActiveChangeCallbacks XML docs in PollingFileChangeToken Co-authored-by: svick <287848+svick@users.noreply.github.com> --- .../src/PollingFileChangeToken.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingFileChangeToken.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingFileChangeToken.cs index 2cf9207f726f96..36bfbde16c644a 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingFileChangeToken.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingFileChangeToken.cs @@ -15,8 +15,10 @@ namespace Microsoft.Extensions.FileProviders.Physical /// /// /// Polling occurs every 4 seconds. - /// This change token does not raise any change callbacks. Callers should watch for to turn - /// from to and dispose the token after this happens. + /// By default, this change token does not raise change callbacks. Callers should watch for to turn + /// from to and dispose the token after this happens. + /// When is , callbacks registered via + /// will be invoked when the file changes. /// public class PollingFileChangeToken : IPollingChangeToken { @@ -54,7 +56,8 @@ private DateTime GetLastWriteTimeUtc() } /// - /// Gets a value that's always . + /// Gets a value that indicates whether this token will proactively raise callbacks. If , the token + /// consumer must poll to detect changes. /// public bool ActiveChangeCallbacks { get; internal set; } From 5bf789271b9094c62b0cff293c870367d4fcb9c1 Mon Sep 17 00:00:00 2001 From: Petr Onderka Date: Thu, 12 Mar 2026 13:40:49 +0100 Subject: [PATCH 6/6] Change token is not disposable --- .../src/PollingFileChangeToken.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingFileChangeToken.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingFileChangeToken.cs index 36bfbde16c644a..36877781d0c0d8 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingFileChangeToken.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PollingFileChangeToken.cs @@ -16,7 +16,7 @@ namespace Microsoft.Extensions.FileProviders.Physical /// /// Polling occurs every 4 seconds. /// By default, this change token does not raise change callbacks. Callers should watch for to turn - /// from to and dispose the token after this happens. + /// from to . /// When is , callbacks registered via /// will be invoked when the file changes. ///