From 23be306c65301f2a894048bb5811962cba9eb31e Mon Sep 17 00:00:00 2001 From: Marc Schier Date: Thu, 24 Sep 2026 07:19:09 -0700 Subject: [PATCH] Update NuGet dependencies (#4536) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - update NuGet dependencies to their latest compatible stable releases while retaining documented compatibility, native, security, and mocking pins - align the nbgv CLI with the central `Nerdbank.GitVersioning` version (3.10.94) and fail explicitly on tool installation/update errors - update the synchronized OpenUSD family to `0.14.0-alpha`; adapt the Vision blank-frame fixture to the new `RenderDiagnosticsState` constructor argument - retain `Microsoft.CodeAnalysis` API packages at the existing 5.0/4.14 host bands: Roslyn 5.9 requires Immutable/Metadata 10.0.1+, while the retained older compiler-host closure is intentionally pinned to 9.0.0 ## Dependency updates - `Dekaf` 1.17.0 → 1.21.1 - legacy ASP.NET Core 2.3 dependencies → 2.3.13; net8/net9 authentication and WebApi test packages → 8.0.31/9.0.20 - `Microsoft.CodeAnalysis.Analyzers` 4.14.0 → 5.9.0 - `TUnit` 1.68.0 → 1.69.0 - `Avalonia` / `Avalonia.Desktop` 12.1.2 → 12.1.3 - schema-test `System.Collections.Immutable` overrides 10.0.11 → 10.0.12 - `AzureSignTool` 3.0.0 → 7.0.1 and `NuGetKeyVaultSignTool` 3.0.45 → 3.2.3 - eight direct OpenUSD packages 0.12.0-alpha → 0.14.0-alpha ## Validation - `dotnet restore UA.slnx --disable-parallel` - clean `UA.slnx` Release build with `CustomTestTarget=net10.0` - `UA.slnx` Release builds with `net48` and `netstandard2.1` - OpenUSD and Vision test suites on net8/net9/net10: 882/882/921 and 484 passed + 1 environment skip on each target - full `Opc.Ua.Tools.Tests` net10.0: 963 passed, 1 skipped - source-generator package validation against a locally packed release package set - updated signing tools installed in an isolated directory; existing `sign` CLI options verified without credentials - nbgv 3.10.94 bootstrap exercised in simulated GitHub CI; disposable committed fixture verified canonical and case-invalid release refs with a four-component version ## Limits No protected signing/publication, Linux/macOS native rendering, or full stress/nightly suites were run locally. --- .azurepipelines/preview.yml | 4 +- .azurepipelines/set-version.ps1 | 45 ++++++++++++-- .github/workflows/nuget-publish.yml | 4 +- Directory.Packages.props | 58 +++++++++---------- .../DefaultComplexTypesCommon.cs | 2 +- .../Types/ComplexTypesCommon.cs | 2 +- .../Types/MockResolverTests.cs | 2 +- .../Opc.Ua.Core.Schema.Tests.csproj | 2 +- .../EncoderCommon.cs | 4 +- .../Types/BuiltIn/VariantTests.cs | 2 +- .../Opc.Ua.PubSub.Schema.Tests.csproj | 2 +- .../PackageVersionPolicyTests.cs | 56 ++++++++++++++++++ .../BlankFrameGuardTests.cs | 9 ++- 13 files changed, 142 insertions(+), 50 deletions(-) diff --git a/.azurepipelines/preview.yml b/.azurepipelines/preview.yml index d8416f2767..dbab874b57 100644 --- a/.azurepipelines/preview.yml +++ b/.azurepipelines/preview.yml @@ -62,13 +62,13 @@ jobs: inputs: command: 'custom' custom: 'tool' - arguments: 'install --version 3.0.0 --tool-path . azuresigntool' + arguments: 'install --version 7.0.1 --tool-path . azuresigntool' displayName: Install AzureSignTool - task: DotNetCoreCLI@2 inputs: command: 'custom' custom: 'tool' - arguments: 'install --version 3.0.45 --tool-path . NuGetKeyVaultSignTool' + arguments: 'install --version 3.2.3 --tool-path . NuGetKeyVaultSignTool' displayName: Install NuGetKeyVaultSignTool - task: NuGetToolInstaller@1 inputs: diff --git a/.azurepipelines/set-version.ps1 b/.azurepipelines/set-version.ps1 index 5ffd0af429..ad56dc7a3a 100644 --- a/.azurepipelines/set-version.ps1 +++ b/.azurepipelines/set-version.ps1 @@ -7,11 +7,44 @@ the rest of the build system. #> -# Try install tool -# Note: Keep Version 3.7.115, it is known working for 4 digit versioning -& dotnet @("tool", "install", "--tool-path", "./tools", "--version", "3.7.115", "--framework", "net80", "nbgv") 2>&1 +# Keep the CLI and the MSBuild package on the same explicit version. A version +# range or omitted --version would make otherwise identical CI runs use +# different nbgv behavior as releases appear on nuget.org. +[xml]$centralPackages = Get-Content -LiteralPath './Directory.Packages.props' -Raw +$nbgvVersions = @($centralPackages.Project.ItemGroup.PackageVersion | + Where-Object { $_.Include -eq 'Nerdbank.GitVersioning' } | + ForEach-Object { $_.Version }) +if ($nbgvVersions.Count -ne 1 -or [string]::IsNullOrWhiteSpace($nbgvVersions[0])) { + throw 'Directory.Packages.props must declare exactly one Nerdbank.GitVersioning version.' +} -$props = (& ./tools/nbgv @("get-version", "-f", "json")) | ConvertFrom-Json +$nbgvVersion = $nbgvVersions[0] +if ($nbgvVersion -notmatch '^\d+\.\d+\.\d+$') { + throw "Nerdbank.GitVersioning version '$nbgvVersion' must be an explicit stable version." +} + +$toolPath = './tools' +$toolExecutable = Join-Path $toolPath 'nbgv' +if ([System.Environment]::OSVersion.Platform -eq [System.PlatformID]::Win32NT) { + $toolExecutable += '.exe' +} + +$toolCommand = if (Test-Path -LiteralPath $toolExecutable) { 'update' } else { 'install' } +& dotnet @( + 'tool', + $toolCommand, + '--tool-path', + $toolPath, + '--version', + $nbgvVersion, + '--framework', + 'net10.0', + 'nbgv') 2>&1 +if ($LastExitCode -ne 0) { + throw "Failed to $toolCommand nbgv $nbgvVersion (exit code $LastExitCode)." +} + +$props = (& $toolExecutable @("get-version", "-f", "json")) | ConvertFrom-Json if ($LastExitCode -ne 0) { throw "Error: 'nbgv get-version -f json' failed with $($LastExitCode)." } @@ -28,11 +61,11 @@ $version = [pscustomobject] @{ # Call versioning for build if ($version.Public -eq 'True') { - & ./tools/nbgv @("cloud", "-c", "-a", "-v", "$($version.Full)$($version.Pre)") + & $toolExecutable @("cloud", "-c", "-a", "-v", "$($version.Full)$($version.Pre)") } else { - & ./tools/nbgv @("cloud", "-c", "-a") + & $toolExecutable @("cloud", "-c", "-a") } if ($LastExitCode -ne 0) { diff --git a/.github/workflows/nuget-publish.yml b/.github/workflows/nuget-publish.yml index c33fe55641..2f6378758e 100644 --- a/.github/workflows/nuget-publish.yml +++ b/.github/workflows/nuget-publish.yml @@ -100,11 +100,11 @@ jobs: shell: pwsh run: | New-Item -ItemType Directory -Force -Path "$env:TOOLS_DIR" | Out-Null - dotnet tool install --version 3.0.0 --tool-path "$env:TOOLS_DIR" AzureSignTool + dotnet tool install --version 7.0.1 --tool-path "$env:TOOLS_DIR" AzureSignTool if ($LASTEXITCODE -ne 0) { throw 'AzureSignTool installation failed.' } - dotnet tool install --version 3.0.45 --tool-path "$env:TOOLS_DIR" NuGetKeyVaultSignTool + dotnet tool install --version 3.2.3 --tool-path "$env:TOOLS_DIR" NuGetKeyVaultSignTool if ($LASTEXITCODE -ne 0) { throw 'NuGetKeyVaultSignTool installation failed.' } diff --git a/Directory.Packages.props b/Directory.Packages.props index 5961a87dea..de0f797a6e 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -20,7 +20,7 @@ - + @@ -28,18 +28,18 @@ - - - - - - - - + + + + + + + + - + @@ -79,7 +79,7 @@ - + - - - - - - - - - - + + + + + + + + + + - - - - + + + + - - - - + + + + diff --git a/tests/Opc.Ua.Client.ComplexTypes.Tests/DefaultComplexTypesCommon.cs b/tests/Opc.Ua.Client.ComplexTypes.Tests/DefaultComplexTypesCommon.cs index d2cc781795..bc237033ff 100644 --- a/tests/Opc.Ua.Client.ComplexTypes.Tests/DefaultComplexTypesCommon.cs +++ b/tests/Opc.Ua.Client.ComplexTypes.Tests/DefaultComplexTypesCommon.cs @@ -119,7 +119,7 @@ namespace Opc.Ua.Client.ComplexTypes.Tests [DatapointSource] public StructureType[] StructureTypes = -#if NET8_0_OR_GREATER && !NET_STANDARD_TESTS +#if NET8_0_OR_GREATER Enum.GetValues(); #else (StructureType[])Enum.GetValues(typeof(StructureType)); diff --git a/tests/Opc.Ua.Client.ComplexTypes.Tests/Types/ComplexTypesCommon.cs b/tests/Opc.Ua.Client.ComplexTypes.Tests/Types/ComplexTypesCommon.cs index 3d75f2fc0a..284ab791f4 100644 --- a/tests/Opc.Ua.Client.ComplexTypes.Tests/Types/ComplexTypesCommon.cs +++ b/tests/Opc.Ua.Client.ComplexTypes.Tests/Types/ComplexTypesCommon.cs @@ -120,7 +120,7 @@ namespace Opc.Ua.Client.ComplexTypes.Tests.Types [DatapointSource] public StructureType[] StructureTypes = -#if NET8_0_OR_GREATER && !NET_STANDARD_TESTS +#if NET8_0_OR_GREATER Enum.GetValues(); #else (StructureType[])Enum.GetValues(typeof(StructureType)); diff --git a/tests/Opc.Ua.Client.ComplexTypes.Tests/Types/MockResolverTests.cs b/tests/Opc.Ua.Client.ComplexTypes.Tests/Types/MockResolverTests.cs index 017b428775..82faffa9ee 100644 --- a/tests/Opc.Ua.Client.ComplexTypes.Tests/Types/MockResolverTests.cs +++ b/tests/Opc.Ua.Client.ComplexTypes.Tests/Types/MockResolverTests.cs @@ -129,7 +129,7 @@ namespace Opc.Ua.Client.ComplexTypes.Tests.Types [DatapointSource] public static readonly TestType[] TypeSource = new TestTypeCollection( -#if NET8_0_OR_GREATER && !NET_STANDARD_TESTS +#if NET8_0_OR_GREATER Enum.GetValues() #else Enum.GetValues(typeof(BuiltInType)) diff --git a/tests/Opc.Ua.Core.Schema.Tests/Opc.Ua.Core.Schema.Tests.csproj b/tests/Opc.Ua.Core.Schema.Tests/Opc.Ua.Core.Schema.Tests.csproj index f8d09f596f..ccfc06a3c2 100644 --- a/tests/Opc.Ua.Core.Schema.Tests/Opc.Ua.Core.Schema.Tests.csproj +++ b/tests/Opc.Ua.Core.Schema.Tests/Opc.Ua.Core.Schema.Tests.csproj @@ -27,7 +27,7 @@ - + diff --git a/tests/Opc.Ua.Core.TestFramework/EncoderCommon.cs b/tests/Opc.Ua.Core.TestFramework/EncoderCommon.cs index 33eec14c3b..11643a8bbb 100644 --- a/tests/Opc.Ua.Core.TestFramework/EncoderCommon.cs +++ b/tests/Opc.Ua.Core.TestFramework/EncoderCommon.cs @@ -186,7 +186,7 @@ namespace Opc.Ua.Core.TestFramework [DatapointSource] public static readonly BuiltInType[] BuiltInTypes = -#if NET8_0_OR_GREATER && !NET_STANDARD_TESTS +#if NET8_0_OR_GREATER [ .. Enum.GetValues() #else @@ -204,7 +204,7 @@ namespace Opc.Ua.Core.TestFramework [DatapointSource] public static readonly EncodingType[] EncoderTypes = -#if NET8_0_OR_GREATER && !NET_STANDARD_TESTS +#if NET8_0_OR_GREATER Enum.GetValues(); #else (EncodingType[])Enum.GetValues(typeof(EncodingType)); diff --git a/tests/Opc.Ua.Core.Tests/Types/BuiltIn/VariantTests.cs b/tests/Opc.Ua.Core.Tests/Types/BuiltIn/VariantTests.cs index 67167e6f33..fda860e60e 100644 --- a/tests/Opc.Ua.Core.Tests/Types/BuiltIn/VariantTests.cs +++ b/tests/Opc.Ua.Core.Tests/Types/BuiltIn/VariantTests.cs @@ -98,7 +98,7 @@ namespace Opc.Ua.Core.Tests.Types.BuiltIn [DatapointSource] public static readonly BuiltInType[] BuiltInTypes = -#if NET8_0_OR_GREATER && !NET_STANDARD_TESTS +#if NET8_0_OR_GREATER [ .. Enum.GetValues() #else diff --git a/tests/Opc.Ua.PubSub.Schema.Tests/Opc.Ua.PubSub.Schema.Tests.csproj b/tests/Opc.Ua.PubSub.Schema.Tests/Opc.Ua.PubSub.Schema.Tests.csproj index 49968f3f4f..01e1dfa0a8 100644 --- a/tests/Opc.Ua.PubSub.Schema.Tests/Opc.Ua.PubSub.Schema.Tests.csproj +++ b/tests/Opc.Ua.PubSub.Schema.Tests/Opc.Ua.PubSub.Schema.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/tests/Opc.Ua.Tools.Tests/PackageVersionPolicyTests.cs b/tests/Opc.Ua.Tools.Tests/PackageVersionPolicyTests.cs index d1f226f43a..a6bc7d4ad3 100644 --- a/tests/Opc.Ua.Tools.Tests/PackageVersionPolicyTests.cs +++ b/tests/Opc.Ua.Tools.Tests/PackageVersionPolicyTests.cs @@ -38,6 +38,7 @@ using System.Text; using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using System.Xml.Linq; using NUnit.Framework; namespace Opc.Ua.Tools.Tests @@ -892,6 +893,61 @@ namespace Opc.Ua.Tools.Tests }); } + [Test] + public void NbgvCliUsesTheCentralPackageVersion() + { + string root = FindRepositoryRoot(); + XDocument packages = XDocument.Load(Path.Combine(root, "Directory.Packages.props")); + string? version = packages + .Descendants("PackageVersion") + .SingleOrDefault(element => + string.Equals( + (string?)element.Attribute("Include"), + "Nerdbank.GitVersioning", + StringComparison.Ordinal)) + ?.Attribute("Version") + ?.Value; + string script = File.ReadAllText(Path.Combine(root, ".azurepipelines", "set-version.ps1")); + + Assert.Multiple(() => + { + Assert.That(version, Is.EqualTo("3.10.94")); + Assert.That( + script, + Does.Contain("$centralPackages.Project.ItemGroup.PackageVersion"), + "The CLI must derive its exact version from central package management."); + Assert.That(script, Does.Contain("'--framework'")); + Assert.That(script, Does.Contain("'net10.0'")); + Assert.That(script, Does.Not.Contain("3.7.115")); + Assert.That( + script, + Does.Contain("[System.Environment]::OSVersion.Platform -eq [System.PlatformID]::Win32NT"), + "Azure invokes this script through Windows PowerShell 5.1, which does not define $IsWindows."); + Assert.That(script, Does.Not.Contain("$IsWindows")); + }); + } + + [Test] + public void OpenUsdPackageFamilyUsesOneVerifiedPrerelease() + { + XDocument packages = XDocument.Load(Path.Combine(FindRepositoryRoot(), "Directory.Packages.props")); + string[] versions = + [ + .. packages + .Descendants("PackageVersion") + .Where(element => + ((string?)element.Attribute("Include"))?.StartsWith("OpenUsd", StringComparison.Ordinal) == true) + .Select(element => (string?)element.Attribute("Version")) + .OfType() + ]; + + Assert.Multiple(() => + { + Assert.That(versions, Has.Length.EqualTo(8)); + Assert.That(versions, Is.All.EqualTo("0.14.0-alpha")); + }); + } + private static string CreateTestPackage(string name, Dictionary entries) { string directory = Path.Combine( diff --git a/tests/Opc.Ua.Vision.Tests/BlankFrameGuardTests.cs b/tests/Opc.Ua.Vision.Tests/BlankFrameGuardTests.cs index 96f47a1dfb..8072b0ae03 100644 --- a/tests/Opc.Ua.Vision.Tests/BlankFrameGuardTests.cs +++ b/tests/Opc.Ua.Vision.Tests/BlankFrameGuardTests.cs @@ -31,6 +31,7 @@ using System; using System.Reflection; using NUnit.Framework; using Opc.Ua.Vision.OpenUsd.Rendering; +using OpenUsd.Rendering; using OpenUsd.Rendering.Silk; namespace Opc.Ua.Vision.Tests @@ -215,12 +216,14 @@ namespace Opc.Ua.Vision.Tests typeof(byte[]), typeof(SilkMeshRenderResult), typeof(ulong), - typeof(uint) + typeof(uint), + typeof(RenderDiagnosticsState) }, modifiers: null); Assert.That(ctor, Is.Not.Null, - "SilkFrameCaptureResult's internal (int,int,byte[],SilkMeshRenderResult,ulong,uint) constructor must exist for BlankFrameGuard tests to construct fixtures."); - return (SilkFrameCaptureResult)ctor!.Invoke(new object[] { width, height, rgba, render, 0UL, 0U }); + "SilkFrameCaptureResult's internal capture constructor must exist for BlankFrameGuard tests to construct fixtures."); + return (SilkFrameCaptureResult)ctor!.Invoke( + new object[] { width, height, rgba, render, 0UL, 0U, RenderDiagnosticsState.Empty }); } } }