[msbuild] Add the latest .NET version as a target framework for MSBuild projects#24522
[msbuild] Add the latest .NET version as a target framework for MSBuild projects#24522rolfbjarne merged 1 commit intomainfrom
Conversation
…ld projects This way we actually get nullability warnings from the compiler. And then fix all the nullability warnings.
There was a problem hiding this comment.
Pull request overview
This PR adds the latest .NET version as an additional target framework for MSBuild projects to enable nullability warnings from the compiler. The changes include fixing numerous nullability warnings throughout the codebase by adding null-forgiving operators and null-coalescing patterns where appropriate.
Changes:
- Updated project files to multi-target both
netstandard2.0and the latest .NET version - Fixed nullability warnings by adding null-forgiving operators (
!) toPath.GetDirectoryName()calls - Added null-conditional operators and null-coalescing patterns to handle potential null references
- Updated external dependency reference
Reviewed changes
Copilot reviewed 61 out of 61 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.Tasks.Windows.csproj | Changed from single target framework to multi-targeting |
| msbuild/Xamarin.MacDev.Tasks/Xamarin.MacDev.Tasks.csproj | Changed from single target framework to multi-targeting |
| msbuild/Xamarin.Localization.MSBuild/Xamarin.Localization.MSBuild.csproj | Changed from single target framework to multi-targeting |
| tools/common/FileUtils.cs | Added null-forgiving operator to Path.GetDirectoryName() |
| msbuild/Xamarin.MacDev.Tasks/Tasks/*.cs | Fixed nullability warnings across multiple task files with null-forgiving operators and null-conditional patterns |
| msbuild/Xamarin.MacDev.Tasks/StringParserService.cs | Simplified variable declaration using pattern matching |
| msbuild/Xamarin.MacDev.Tasks/Extensions/ITaskItemExtensions.cs | Added null-forgiving operator for dictionary value cast |
| external/Xamarin.MacDev | Updated submodule commit reference |
Comments suppressed due to low confidence (2)
msbuild/Xamarin.MacDev.Tasks/Tasks/SmartCopy.cs:1
- The struct name changed from 'timespec' to 'Timespec', but this deviates from the standard POSIX naming convention for the timespec structure. If this struct represents the POSIX timespec type, it should retain the lowercase 'timespec' name for clarity and consistency with the native API it represents.
msbuild/Xamarin.MacDev.Tasks/Tasks/Zip.cs:1 - Two separate comments have been merged onto the same line without proper separation. These should be on separate lines or combined into a single coherent comment.
✅ [CI Build #2a5fc45] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #2a5fc45] Build passed (Detect API changes) ✅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 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #2a5fc45] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #2a5fc45] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #2a5fc45] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #2a5fc45] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
💻 [CI Build #2a5fc45] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
💻 [CI Build #2a5fc45] Tests on macOS arm64 - Mac Tahoe (26) passed 💻✅ All tests on macOS arm64 - Mac Tahoe (26) passed. Pipeline on Agent |
🚀 [CI Build #2a5fc45] 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 |
This way we actually get nullability warnings from the compiler.
And then fix all the nullability warnings.