diff --git a/.editorconfig b/.editorconfig index d578de1..ae64796 100644 --- a/.editorconfig +++ b/.editorconfig @@ -333,6 +333,6 @@ csharp_preserve_single_line_statements = false csharp_preserve_single_line_blocks = true [src/ChildProcess.Test/**.cs] -# Suppress false CA1825 on MemberData when using .NET 6 analyers -# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1825 -dotnet_diagnostic.CA1825.severity = none # Avoid zero-length array allocations. +# Fine for tests +dotnet_diagnostic.CA1861.severity = none # Prefer 'static readonly' fields over constant array arguments +dotnet_diagnostic.CA1849.severity = none # Call async methods when in an async method \ No newline at end of file diff --git a/build/azure-pipelines/prepare-dotnet.yml b/build/azure-pipelines/prepare-dotnet.yml index 0e22178..621c386 100644 --- a/build/azure-pipelines/prepare-dotnet.yml +++ b/build/azure-pipelines/prepare-dotnet.yml @@ -2,7 +2,7 @@ parameters: [] steps: - task: UseDotNet@2 - displayName: 'Use .NET SDK 6.0.412' + displayName: 'Use .NET SDK 8.0.203' inputs: packageType: sdk - version: 6.0.412 + version: 8.0.203 diff --git a/build/azure-pipelines/test.yml b/build/azure-pipelines/test.yml index 6b6dd09..3554b32 100644 --- a/build/azure-pipelines/test.yml +++ b/build/azure-pipelines/test.yml @@ -43,20 +43,20 @@ steps: condition: ${{ ne(parameters.platform, 'win') }} inputs: targetType: 'inline' - script: 'chmod -R +x $(Build.SourcesDirectory)/bin/ChildProcess.Native $(Build.SourcesDirectory)/bin/ChildProcess.Test/AnyCPU/${{ parameters.configuration }}/net6.0/runtimes' + script: 'chmod -R +x $(Build.SourcesDirectory)/bin/ChildProcess.Native $(Build.SourcesDirectory)/bin/ChildProcess.Test/AnyCPU/${{ parameters.configuration }}/net8.0/runtimes' # Our Alpine container cannot build, so copy TestChildNative here. - task: CopyFiles@2 inputs: sourceFolder: '$(Build.SourcesDirectory)/bin/ChildProcess.Native/${{ parameters.rid }}/${{ parameters.configuration }}' contents: 'TestChildNative*' - targetFolder: '$(Build.SourcesDirectory)/bin/ChildProcess.Test/AnyCPU/${{ parameters.configuration }}/net6.0' + targetFolder: '$(Build.SourcesDirectory)/bin/ChildProcess.Test/AnyCPU/${{ parameters.configuration }}/net8.0' overwrite: true - task: DotNetCoreCLI@2 displayName: 'dotnet test' inputs: command: test - projects: '$(Build.SourcesDirectory)/bin/ChildProcess.Test/AnyCPU/${{ parameters.configuration }}/net6.0/Asmichi.ChildProcess.Test.dll' + projects: '$(Build.SourcesDirectory)/bin/ChildProcess.Test/AnyCPU/${{ parameters.configuration }}/net8.0/Asmichi.ChildProcess.Test.dll' arguments: '-- RunConfiguration.TestSessionTimeout=${{ parameters.testTimeoutMilliseconds }}' testRunTitle: ${{ parameters.rid }} diff --git a/global.json b/global.json index 6bc1716..30823ad 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,5 @@ { "sdk": { - "version": "6.0.412", - "rollForward": "latestFeature" + "version": "8.0.203" } } \ No newline at end of file diff --git a/src/ChildProcess.Example/ChildProcess.Example.csproj b/src/ChildProcess.Example/ChildProcess.Example.csproj index 2d7cd42..db883e9 100644 --- a/src/ChildProcess.Example/ChildProcess.Example.csproj +++ b/src/ChildProcess.Example/ChildProcess.Example.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 diff --git a/src/ChildProcess.ExamplePreview/ChildProcess.ExamplePreview.csproj b/src/ChildProcess.ExamplePreview/ChildProcess.ExamplePreview.csproj index c7fbd03..86028a6 100644 --- a/src/ChildProcess.ExamplePreview/ChildProcess.ExamplePreview.csproj +++ b/src/ChildProcess.ExamplePreview/ChildProcess.ExamplePreview.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 diff --git a/src/ChildProcess.ExamplePreview/ChildProcessExamplesUnix.cs b/src/ChildProcess.ExamplePreview/ChildProcessExamplesUnix.cs index a61ab76..6d8e46a 100644 --- a/src/ChildProcess.ExamplePreview/ChildProcessExamplesUnix.cs +++ b/src/ChildProcess.ExamplePreview/ChildProcessExamplesUnix.cs @@ -8,6 +8,8 @@ using System.Threading.Tasks; using Asmichi.ProcessManagement; +#pragma warning disable CA1849 // Call async methods when in an async method + namespace Asmichi { public static class ChildProcessExamplesUnix diff --git a/src/ChildProcess.ExamplePreview/ChildProcessExamplesWindows.cs b/src/ChildProcess.ExamplePreview/ChildProcessExamplesWindows.cs index a6dc928..59d7ec0 100644 --- a/src/ChildProcess.ExamplePreview/ChildProcessExamplesWindows.cs +++ b/src/ChildProcess.ExamplePreview/ChildProcessExamplesWindows.cs @@ -9,6 +9,8 @@ using System.Threading.Tasks; using Asmichi.ProcessManagement; +#pragma warning disable CA1849 // Call async methods when in an async method + namespace Asmichi { public static class ChildProcessExamplesWindows diff --git a/src/ChildProcess.Test/ChildProcess.Test.csproj b/src/ChildProcess.Test/ChildProcess.Test.csproj index 492f708..490e8d9 100644 --- a/src/ChildProcess.Test/ChildProcess.Test.csproj +++ b/src/ChildProcess.Test/ChildProcess.Test.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 @@ -46,9 +46,9 @@ - - - + + + diff --git a/src/ChildProcess.Test/ProcessManagement/ChildProcessExecutionTestUtil.cs b/src/ChildProcess.Test/ProcessManagement/ChildProcessExecutionTestUtil.cs index 1d49c67..406cd11 100644 --- a/src/ChildProcess.Test/ProcessManagement/ChildProcessExecutionTestUtil.cs +++ b/src/ChildProcess.Test/ProcessManagement/ChildProcessExecutionTestUtil.cs @@ -1,7 +1,6 @@ // Copyright (c) @asmichi (https://github.com/asmichi). Licensed under the MIT License. See LICENCE in the project root for details. using System.IO; -using System.Runtime.Serialization; using System.Text; namespace Asmichi.ProcessManagement @@ -50,10 +49,5 @@ public ChildProcessFailedException(string message, System.Exception inner) : base(message, inner) { } - - protected ChildProcessFailedException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } } } diff --git a/src/TestChild/TestChild.csproj b/src/TestChild/TestChild.csproj index cfb5544..1747e54 100644 --- a/src/TestChild/TestChild.csproj +++ b/src/TestChild/TestChild.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0