Upgrade Contracts to net8#1837
Open
ryanbrandenburg wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Microsoft.ComponentDetection.Contracts project to build on .NET 8 (by removing its netstandard2.0 override so it inherits the repo-wide net8.0 target), and adjusts a few APIs/usages accordingly within the Contracts layer.
Changes:
- Upgraded Contracts from
netstandard2.0to repo-defaultnet8.0by removing the per-projectTargetFrameworkoverride. - Adopted .NET 8/BCL language/runtime features (range slicing,
ArgumentNullException.ThrowIfNull) to resolve build issues after the framework upgrade. - Minor cleanup/formatting changes (including a small interface signature update).
Show a summary per file
| File | Description |
|---|---|
| src/Microsoft.ComponentDetection.Contracts/TypedComponent/GoComponent.cs | Uses range slicing for namespace/name extraction now that Contracts targets .NET 8. |
| src/Microsoft.ComponentDetection.Contracts/TypedComponent/GitComponent.cs | Uses range slicing to trim .git suffix under .NET 8. |
| src/Microsoft.ComponentDetection.Contracts/Microsoft.ComponentDetection.Contracts.csproj | Removes netstandard2.0 override so the project targets repo-default net8.0. |
| src/Microsoft.ComponentDetection.Contracts/IComponentStream.cs | Removes #nullable disable and adds explicit accessibility modifiers on interface members. |
| src/Microsoft.ComponentDetection.Contracts/FileComponentDetectorWithCleanup.cs | Replaces manual null-check with ArgumentNullException.ThrowIfNull. |
| src/Microsoft.ComponentDetection.Common/Microsoft.ComponentDetection.Common.csproj | Whitespace-only cleanup. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Low
Comment on lines
10
to
12
| /// <summary> | ||
| /// Gets the stream object that was discovered by the provided pattern to <see cref="IComponentStreamEnumerableFactory" /> />. | ||
| /// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Went to use some newer language features in the Contracts projects and they weren't available because it was still on netstandard. Upgraded to net8 as per https://devblogs.microsoft.com/dotnet/the-future-of-net-standard/ and then fixed the resulting build errors.