Skip to content

Document breaking change: PhysicalFilesWatcher validates root and FileSystemWatcher paths - #55776

Open
gewarren with Copilot wants to merge 3 commits into
mainfrom
copilot/breaking-change-validate-physical-files-watcher
Open

Document breaking change: PhysicalFilesWatcher validates root and FileSystemWatcher paths#55776
gewarren with Copilot wants to merge 3 commits into
mainfrom
copilot/breaking-change-validate-physical-files-watcher

Conversation

Copilot AI commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

PhysicalFilesWatcher constructors now validate the root argument and its relationship to a supplied FileSystemWatcher.Path, rejecting combinations at construction time that previously succeeded but generally didn't work correctly.

New breaking-change article

  • Added docs/core/compatibility/extensions/11/physicalfileswatcher-validates-root-path.md covering:
    • root is now normalized via Path.GetFullPath(); null throws ArgumentNullException, invalid paths propagate the Path.GetFullPath() exception.
    • A nonempty FileSystemWatcher.Path unrelated to root now throws ArgumentException. It must be empty, equal to root, or an ancestor/descendant of it.
    • A nonexistent root directory remains valid (watching is deferred until it's created).

Index updates

  • Added the article to the .NET 11 toc.yml and 11.md under the Extensions area.

Example of the now-invalid pattern called out in the article:

using var fileSystemWatcher = new FileSystemWatcher(unrelatedPath);
using var watcher = new PhysicalFilesWatcher(
    root,
    fileSystemWatcher,
    pollForChanges: false); // now throws ArgumentException

Internal previews

File Preview link
docs/core/compatibility/11.md Learn preview
docs/core/compatibility/extensions/11/physicalfileswatcher-validates-root-path.md Learn preview
docs/core/compatibility/toc.yml Learn preview

Build report

Copilot AI self-assigned this Aug 28, 2026
Copilot AI lite review requested due to automatic review settings August 28, 2026 21:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

…breaking change

Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix PhysicalFilesWatcher to validate root and FileSystemWatcher paths Document breaking change: PhysicalFilesWatcher validates root and FileSystemWatcher paths Aug 28, 2026
Copilot AI requested a review from gewarren August 28, 2026 21:45
Comment thread docs/core/compatibility/extensions/11/physicalfileswatcher-validates-root-path.md Outdated
@gewarren
gewarren marked this pull request as ready for review August 28, 2026 21:50
@gewarren
gewarren requested a review from a team as a code owner August 28, 2026 21:50
@gewarren
gewarren enabled auto-merge (squash) August 28, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Breaking change]: PhysicalFilesWatcher validates root and FileSystemWatcher paths

3 participants