Fix dotnet/runtime#103468: Add DirectoryPath property and constructors to DirectoryNotFoundException#45
Conversation
…ectoryNotFoundException Related: dotnet#103468 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 API Surface Review — PR #45Public API changes detected: Yes New API Members
Findings✅ API ApprovalIssue dotnet/runtime#103468 carries the ✅ Ref Assembly Updated
|
| File | Line | Path variable available |
|---|---|---|
Common/src/System/IO/Win32Marshal.cs |
38 | path |
Common/src/Interop/Unix/Interop.IOErrors.cs |
133–134 | path |
System.Formats.Tar/src/.../TarFile.cs |
70, 138, 193, 256, 312, 380, 443, 512 | sourceDirectoryName / destinationDirectoryName |
System.Private.CoreLib/.../FileSystem.Unix.cs |
421, 457 | sourceFullPath |
System.Private.CoreLib/.../FileInfo.cs |
185 | FullName |
System.IO.IsolatedStorage/.../IsolatedStorageFile.cs |
363 | sourceDirectoryName |
System.Threading.AccessControl/.../MutexAcl.cs |
91 | name |
System.Threading.AccessControl/.../EventWaitHandleAcl.cs |
100 | name |
System.Private.CoreLib/.../Mutex.cs |
144 | name |
System.Private.CoreLib/.../EventWaitHandle.cs |
123 | name |
At minimum, the low-level marshaling helpers (Win32Marshal.cs, Interop.IOErrors.cs) should adopt the new constructor so that all system-thrown DirectoryNotFoundException instances carry DirectoryPath.
✅ No Breaking Changes
All changes are purely additive.
Verdict
- Missing
ToString()override breaks the diagnostic pattern established byFileNotFoundException. GetObjectDatashould use theObsoletionsconstants instead of hardcoded strings.- Significant adoption opportunities exist in the tree (especially
Win32Marshal.csandInterop.IOErrors.cs) that would make the new property immediately useful for system-thrown exceptions.
Generated by API Surface Review for issue #45 · ◷
🤖 Copilot Code Review — PR #45Note This review was AI-generated by GitHub Copilot using Claude Opus 4.6, with additional analysis from Claude Sonnet 4.5. Holistic AssessmentMotivation: The PR adds a Approach: The implementation follows the Summary: Detailed Findings
|
|
Closing: superseded by pipeline improvements. 1 issue = 1 PR rule. |
AI Fix: Add DirectoryPath property and constructors to DirectoryNotFoundException
Issue: dotnet#103468
Root cause: DirectoryNotFoundException lacked DirectoryPath and matching constructors, unlike FileNotFoundException, leading to inconsistency and missing context for consumers.
Fix: Added DirectoryPath property, new constructors, and serialization support to DirectoryNotFoundException. Updated ref assembly and added tests.
Self-review: Correctness ✅ | Tests ✅ | Breaking ✅
Note
This PR was generated with the assistance of GitHub Copilot AI.