fix: netstandard2.0 compat and add Release build to CI#178
Merged
elantiguamsft merged 1 commit intomainfrom Mar 18, 2026
Merged
fix: netstandard2.0 compat and add Release build to CI#178elantiguamsft merged 1 commit intomainfrom
elantiguamsft merged 1 commit intomainfrom
Conversation
elantiguamsft
previously approved these changes
Mar 17, 2026
1f1fb45 to
1f19744
Compare
- Replace string.Contains(string, StringComparison) with IndexOf in MstServiceException.cs. The 2-arg Contains overload is not available in netstandard2.0; .NET 10 SDK polyfills it silently, but .NET 8 SDK (used by the internal ADO pipeline) does not. - Add a Release build step to the GitHub CI workflow so configuration- specific issues are caught before merge. - Remove global RuntimeIdentifier=osx-arm64 from Directory.Build.props. It conflicted with CoseSignTool.csproj's RuntimeIdentifiers on .NET SDK 10.x (NETSDK1032). TestingPlatformArchitecture=arm64 is sufficient for test runner support on macOS ARM64. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1f19744 to
82c3a9f
Compare
elantiguamsft
approved these changes
Mar 18, 2026
NN2000X
approved these changes
Mar 18, 2026
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.
Problem
MstServiceException.csusesstring.Contains(string, StringComparison)which is not available innetstandard2.0. The .NET 10 SDK silently polyfills this API, so GitHub CI and local builds pass, but the internal ADO pipeline (using .NET 8 SDK) fails on the Release build.Additionally, GitHub CI only builds Debug configuration, so Release-only issues are not caught before merge.
Changes
Contains(..., StringComparison)withIndexOf(..., StringComparison) >= 0which is available across allnetstandard2.0SDK versions.Build Releasestep after tests so both configurations are validated in PR CI.Why Debug passed
The .NET 10 SDK (used locally and in GitHub CI) provides implicit polyfills for newer string APIs when targeting
netstandard2.0. The .NET 8 SDK used by the ADO pipeline does not, exposing the incompatibility only in that environment.