diff --git a/.github/workflows/ARM.yml b/.github/workflows/ARM.yml index eef0e666d..deff6b8f6 100644 --- a/.github/workflows/ARM.yml +++ b/.github/workflows/ARM.yml @@ -19,7 +19,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - name: Clean previous install run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8485189e1..943b20f2f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,7 +37,7 @@ jobs: # This fails in pytest with: # CSC : error CS4023: /platform:anycpu32bitpreferred can only be used with /t:exe, /t:winexe and /t:appcontainerexe [D:\a\pythonnet\pythonnet\src\runtime\Python.Runtime.csproj] exclude: - - os: + - os: category: windows platform: x86 python: "3.13" @@ -55,7 +55,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v2 diff --git a/src/embed_tests/Python.EmbeddingTest.csproj b/src/embed_tests/Python.EmbeddingTest.csproj index 4993994d3..2b3d6610e 100644 --- a/src/embed_tests/Python.EmbeddingTest.csproj +++ b/src/embed_tests/Python.EmbeddingTest.csproj @@ -1,7 +1,7 @@ - net472;net6.0 + net472;net8.0 ..\pythonnet.snk true diff --git a/src/python_tests_runner/Python.PythonTestsRunner.csproj b/src/python_tests_runner/Python.PythonTestsRunner.csproj index 63981c424..964166907 100644 --- a/src/python_tests_runner/Python.PythonTestsRunner.csproj +++ b/src/python_tests_runner/Python.PythonTestsRunner.csproj @@ -1,7 +1,7 @@ - net472;net6.0 + net472;net8.0 diff --git a/src/runtime/StateSerialization/RuntimeData.cs b/src/runtime/StateSerialization/RuntimeData.cs index 8eda9ce0b..4ed654a0c 100644 --- a/src/runtime/StateSerialization/RuntimeData.cs +++ b/src/runtime/StateSerialization/RuntimeData.cs @@ -18,11 +18,19 @@ public static class RuntimeData public readonly static Func DefaultFormatterFactory = () => { - try + var fw = RuntimeInformation.FrameworkDescription; + if (fw.StartsWith(".NET Framework") || fw.StartsWith("Mono")) { - return new BinaryFormatter(); + try + { + return new BinaryFormatter(); + } + catch + { + return new NoopFormatter(); + } } - catch + else { return new NoopFormatter(); } diff --git a/src/testing/Python.Test.csproj b/src/testing/Python.Test.csproj index 3adc5c0c6..b7ba6cd4e 100644 --- a/src/testing/Python.Test.csproj +++ b/src/testing/Python.Test.csproj @@ -1,6 +1,6 @@ - netstandard2.0;net6.0 + netstandard2.0;net8.0 true true ..\pythonnet.snk