[msbuild] Avoid using deprecated API#24512
Conversation
Uri.EscapeUriString is deprecated, so create a Uri instance instead, which does the escaping we want (for instance: escape spaces in the uri we construct, but doesn't escape any directory separators).
There was a problem hiding this comment.
Pull request overview
This PR updates the CreateAssetPackManifest task to avoid using the deprecated Uri.EscapeUriString API by constructing a Uri instance instead, which automatically handles URI escaping.
Changes:
- Replaced
Uri.EscapeUriString(Path.GetFullPath(dir))withnew Uri("http://127.0.0.1" + Path.GetFullPath(dir), UriKind.Absolute).AbsoluteUrito modernize the code and avoid using a deprecated API.
✅ [CI Build #e642e7a] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #e642e7a] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ [CI Build #e642e7a] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #e642e7a] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #e642e7a] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #e642e7a] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [CI Build #e642e7a] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
💻 [CI Build #e642e7a] Tests on macOS arm64 - Mac Tahoe (26) passed 💻✅ All tests on macOS arm64 - Mac Tahoe (26) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #e642e7a] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 121 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
Uri.EscapeUriString is deprecated, so create a Uri instance instead, which
does the escaping we want (for instance: escape spaces in the uri we
construct, but doesn't escape any directory separators).