Skip to content

Adopt .NET 10 with multitargeting#25

Open
JohnCampionJr wants to merge 3 commits into
solarwinds:mainfrom
jcamp-code:feature/adopt-net10
Open

Adopt .NET 10 with multitargeting#25
JohnCampionJr wants to merge 3 commits into
solarwinds:mainfrom
jcamp-code:feature/adopt-net10

Conversation

@JohnCampionJr

Copy link
Copy Markdown

Closes #16.

Multi-targets net8.0 and net10.0 for both the tool and the tests, bumps the SDK and CI to .NET 10, and runs the test suite against both runtimes.

Raising AnalysisLevel to 10 (tracking the new TFM) surfaced two rules, fixed rather than suppressed:

  • CA1515: made the app's types internal. Added InternalsVisibleTo for DynamicProxyGenAssembly2 so Moq can still mock the now-internal interfaces.
  • CA1872: use Convert.ToHexString in the test hash helper.

Left the Spectre.Console and other package upgrades out to keep this focused; can follow up separately.

Also adds macOS support to ProcessExecutorTests (was throwing on OSX).

Multi-target net8.0;net10.0 for the tool and tests, bump the SDK and CI to .NET 10, and run the tests on both runtimes. AnalysisLevel tracks the TFM now; fixed the findings it surfaced (CA1515 -> internal types with InternalsVisibleTo for Moq, CA1872 -> Convert.ToHexString).
@JohnCampionJr

Copy link
Copy Markdown
Author

Sorry, accidentally closed it; certainly didn't mean to.

@JohnCampionJr JohnCampionJr marked this pull request as ready for review June 8, 2026 18:38
Copilot AI review requested due to automatic review settings June 8, 2026 18:38
@JohnCampionJr JohnCampionJr requested a review from a team as a code owner June 8, 2026 18:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adopts .NET 10 by multi-targeting the tool and test projects (net8.0 + net10.0), updates CI/CodeQL SDK setup accordingly, and reduces the library’s exposed surface area by making several types internal.

Changes:

  • Multi-target the main package and tests for net8.0;net10.0 and adjust language/analyzer settings per target.
  • Update CI/CodeQL workflows and global.json to use .NET 10 SDK.
  • Make multiple previously public types internal and add InternalsVisibleTo for proxy-based mocking.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/SolarWinds.Changesets.Tests/Version/CsProjectsRepositoryTests.cs Simplifies SHA256 hash-to-hex conversion using Convert.ToHexString.
tests/SolarWinds.Changesets.Tests/SolarWinds.Changesets.Tests.csproj Multi-targets tests for net8.0 and net10.0.
tests/SolarWinds.Changesets.Tests/ProcessExecutorTests.cs Extends non-Windows test execution path to include macOS.
src/SolarWinds.Changesets/SolarWinds.Changesets.csproj Multi-targets package and enables internals access for dynamic proxy mocking.
src/SolarWinds.Changesets/Shared/ResultCodes.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/ProcessOutput.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/ProcessExecutor.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/InitializationException.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/IProcessExecutor.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/IConfigurationService.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/IChangesetsRepository.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/Constants.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/ChangesetFile.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/ChangesetConfig.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/BumpType.cs Changes visibility to internal.
src/SolarWinds.Changesets/Commands/Publish/Services/IGitService.cs Changes visibility to internal.
src/SolarWinds.Changesets/Commands/Publish/Services/IDotnetService.cs Changes visibility to internal.
src/SolarWinds.Changesets/Commands/Publish/Services/GitService.cs Changes visibility to internal.
src/SolarWinds.Changesets/Commands/Publish/Services/DotnetService.cs Changes visibility to internal.
src/SolarWinds.Changesets/Commands/Add/IProjectFileNamesLocator.cs Changes visibility to internal.
global.json Pins repo SDK to .NET 10 feature band.
Directory.Build.props Conditions C# language and analyzer levels per target framework.
.github/workflows/codeql.yml Uses .NET 10 SDK for CodeQL build.
.github/workflows/ci.yml Installs both .NET 8 and .NET 10 SDKs in CI.
.changeset/adopt-dotnet-10.md Adds a changeset entry describing .NET 10 adoption.

Comment thread src/SolarWinds.Changesets/Shared/ResultCodes.cs
Comment thread global.json Outdated
Comment thread Directory.Build.props
Comment on lines +6 to +7
<LangVersion Condition="'$(TargetFramework)' == 'net8.0'">12.0</LangVersion>
<LangVersion Condition="'$(TargetFramework)' == 'net10.0'">14.0</LangVersion>
Comment thread Directory.Build.props
Comment on lines +27 to +28
<AnalysisLevel Condition="'$(TargetFramework)' == 'net8.0'">8</AnalysisLevel>
<AnalysisLevel Condition="'$(TargetFramework)' == 'net10.0'">10</AnalysisLevel>
Use 10.0.100 with rollForward latestFeature so any installed .NET 10 feature band
satisfies it, instead of requiring 10.0.300 or higher.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Adopt .NET 10

2 participants