From 82c3a9fb4b09e4a48a7ffeda4ba1e0daa1fe2a7c Mon Sep 17 00:00:00 2001 From: "Jeromy Statia (from Dev Box)" Date: Mon, 16 Mar 2026 18:19:53 -0700 Subject: [PATCH] fix: netstandard2.0 compat, add Release build to CI, fix macOS arm64 - 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> --- .github/workflows/dotnet.yml | 4 ++++ CoseSign1.Transparent.MST/MstServiceException.cs | 2 +- Directory.Build.props | 2 -- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 150f11a1..63e3f01e 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -73,6 +73,10 @@ jobs: dotnet test --no-restore CoseSignTool.MST.Plugin.Tests/CoseSignTool.MST.Plugin.Tests.csproj dotnet test --no-restore CoseSignTool.IndirectSignature.Plugin.Tests/CoseSignTool.IndirectSignature.Plugin.Tests.csproj + # Build Release to catch issues the internal ADO pipeline would hit (e.g. netstandard2.0 API surface differences). + - name: Build Release + run: dotnet build --configuration Release CoseSignTool.sln + # List the contents of the working directory to make sure all the artifacts are there. - name: List working directory run: ${{ matrix.dir_command }} diff --git a/CoseSign1.Transparent.MST/MstServiceException.cs b/CoseSign1.Transparent.MST/MstServiceException.cs index f276d392..e2acc4f5 100644 --- a/CoseSign1.Transparent.MST/MstServiceException.cs +++ b/CoseSign1.Transparent.MST/MstServiceException.cs @@ -126,7 +126,7 @@ public static MstServiceException FromRequestFailedException(Azure.RequestFailed { var contentType = response.Headers.ContentType; - if (contentType?.Contains("cbor", StringComparison.OrdinalIgnoreCase) == true) + if (contentType?.IndexOf("cbor", StringComparison.OrdinalIgnoreCase) >= 0) { try { diff --git a/Directory.Build.props b/Directory.Build.props index f15f7d97..1c4e5f1e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,7 +7,5 @@ true arm64 - - osx-arm64