diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 4096c16..8517e11 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -178,10 +178,10 @@ jobs: # ── Build and test ───────────────────────────────────────────────── - name: Build module - run: dotnet publish src/PSProxmoxVE/PSProxmoxVE.csproj --configuration Release --framework net9.0 --output ./publish/net9.0 + run: dotnet publish src/PSProxmoxVE/PSProxmoxVE.csproj --configuration Release --framework netstandard2.0 --output ./publish/netstandard2.0 - name: Clean publish output for PS module loading - run: rm -f ./publish/net9.0/*.deps.json ./publish/net9.0/*.runtimeconfig.json + run: rm -f ./publish/netstandard2.0/*.deps.json - name: Install Pester 5 shell: pwsh @@ -192,7 +192,7 @@ jobs: run: | $modulePath = "$HOME/.local/share/powershell/Modules/PSProxmoxVE" New-Item -ItemType Directory -Path $modulePath -Force | Out-Null - Copy-Item -Path ./publish/net9.0/* -Destination $modulePath -Recurse -Force + Copy-Item -Path ./publish/netstandard2.0/* -Destination $modulePath -Recurse -Force - name: Create test ISO shell: bash @@ -201,8 +201,6 @@ jobs: - name: Run integration tests shell: pwsh env: - DOTNET_ROOT: '' - DOTNET_MULTILEVEL_LOOKUP: '' PVETEST_HOST: ${{ steps.target.outputs.host }} PVETEST_PORT: ${{ steps.target.outputs.port }} PVETEST_APITOKEN: ${{ steps.target.outputs.token }} diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index d8406ba..4339bb1 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -18,9 +18,9 @@ jobs: - os: windows-latest framework: net48 - os: windows-latest - framework: net9.0 + framework: netstandard2.0 - os: ubuntu-latest - framework: net9.0 + framework: netstandard2.0 steps: - uses: actions/checkout@v5 @@ -58,17 +58,17 @@ jobs: shell: powershell - os: windows-latest ps_version: '7.5' - framework: net9.0 + framework: netstandard2.0 artifact_os: windows-latest shell: pwsh - os: ubuntu-latest ps_version: '7.5' - framework: net9.0 + framework: netstandard2.0 artifact_os: ubuntu-latest shell: pwsh - os: macos-latest ps_version: '7.5' - framework: net9.0 + framework: netstandard2.0 artifact_os: ubuntu-latest shell: pwsh diff --git a/src/PSProxmoxVE.Core/Client/PveHttpClient.cs b/src/PSProxmoxVE.Core/Client/PveHttpClient.cs index 721eca2..02c1600 100644 --- a/src/PSProxmoxVE.Core/Client/PveHttpClient.cs +++ b/src/PSProxmoxVE.Core/Client/PveHttpClient.cs @@ -10,7 +10,7 @@ using Newtonsoft.Json.Linq; using PSProxmoxVE.Core.Authentication; using PSProxmoxVE.Core.Exceptions; -#if NET48 +#if NET48 || NETSTANDARD2_0 using System.Net.Security; using System.Security.Cryptography.X509Certificates; #endif @@ -35,7 +35,7 @@ namespace PSProxmoxVE.Core.Client _session = session ?? throw new ArgumentNullException(nameof(session)); _baseUrl = session.BaseUrl; -#if NET48 +#if NET48 || NETSTANDARD2_0 var handler = new HttpClientHandler(); if (session.SkipCertificateCheck) { @@ -75,7 +75,7 @@ namespace PSProxmoxVE.Core.Client _session = null; _baseUrl = $"https://{hostname}:{port}"; -#if NET48 +#if NET48 || NETSTANDARD2_0 var handler = new HttpClientHandler(); if (skipCertificateCheck) { @@ -286,7 +286,7 @@ namespace PSProxmoxVE.Core.Client } finally { -#if NET48 +#if NET48 || NETSTANDARD2_0 fileStream.Dispose(); #else await fileStream.DisposeAsync().ConfigureAwait(false); diff --git a/src/PSProxmoxVE.Core/PSProxmoxVE.Core.csproj b/src/PSProxmoxVE.Core/PSProxmoxVE.Core.csproj index f00c7d2..5b444e8 100644 --- a/src/PSProxmoxVE.Core/PSProxmoxVE.Core.csproj +++ b/src/PSProxmoxVE.Core/PSProxmoxVE.Core.csproj @@ -1,7 +1,7 @@ - net9.0;net48 + netstandard2.0;net9.0;net48 10.0 enable PSProxmoxVE.Core @@ -16,6 +16,11 @@ + + + + + diff --git a/src/PSProxmoxVE/PSProxmoxVE.csproj b/src/PSProxmoxVE/PSProxmoxVE.csproj index 8baa638..f1ce353 100644 --- a/src/PSProxmoxVE/PSProxmoxVE.csproj +++ b/src/PSProxmoxVE/PSProxmoxVE.csproj @@ -1,7 +1,7 @@ - net9.0;net48 + netstandard2.0;net9.0;net48 10.0 enable PSProxmoxVE @@ -14,7 +14,7 @@ - + diff --git a/tests/PSProxmoxVE.Tests/_TestHelper.ps1 b/tests/PSProxmoxVE.Tests/_TestHelper.ps1 index 57cc926..af43701 100644 --- a/tests/PSProxmoxVE.Tests/_TestHelper.ps1 +++ b/tests/PSProxmoxVE.Tests/_TestHelper.ps1 @@ -30,10 +30,10 @@ $repoRoot = Resolve-Path (Join-Path $PSScriptRoot '../..') $moduleRoot = Join-Path $repoRoot 'src/PSProxmoxVE' if ($PSVersionTable.PSEdition -eq 'Core') { - $frameworks = @('net9.0', 'net48') + $frameworks = @('netstandard2.0', 'net9.0', 'net48') } else { - $frameworks = @('net48', 'net9.0') + $frameworks = @('net48', 'netstandard2.0', 'net9.0') } $searchPaths = foreach ($fw in $frameworks) {