From f20569bc73034be67032ad3c4c30f7fbfe0b304c Mon Sep 17 00:00:00 2001 From: Archie Date: Mon, 10 Mar 2025 09:59:39 -0600 Subject: [PATCH 1/2] Upgrade to net 8.0 --- Opc2Aml.csproj | 2 +- Opc2AmlConsole/Opc2AmlConsole.csproj | 2 +- SystemTest/SystemTest.csproj | 2 +- SystemTest/TestCommandLine.cs | 17 ++++++++++++++++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Opc2Aml.csproj b/Opc2Aml.csproj index 177a047..bcd36c0 100644 --- a/Opc2Aml.csproj +++ b/Opc2Aml.csproj @@ -2,7 +2,7 @@ Library - net6.0 + net8.0 false false diff --git a/Opc2AmlConsole/Opc2AmlConsole.csproj b/Opc2AmlConsole/Opc2AmlConsole.csproj index 71fc579..c391fcb 100644 --- a/Opc2AmlConsole/Opc2AmlConsole.csproj +++ b/Opc2AmlConsole/Opc2AmlConsole.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 enable enable diff --git a/SystemTest/SystemTest.csproj b/SystemTest/SystemTest.csproj index dee16c6..f61333f 100644 --- a/SystemTest/SystemTest.csproj +++ b/SystemTest/SystemTest.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 enable false diff --git a/SystemTest/TestCommandLine.cs b/SystemTest/TestCommandLine.cs index fa0c7a5..fc00ee0 100644 --- a/SystemTest/TestCommandLine.cs +++ b/SystemTest/TestCommandLine.cs @@ -4,6 +4,8 @@ using System.Diagnostics; using System.IO; using System.Linq; +using System.Reflection; +using System.Runtime.Versioning; using System.Text; using System.Threading.Tasks; using static Org.BouncyCastle.Math.EC.ECCurve; @@ -332,7 +334,20 @@ private string ConfigDirectoryString() private string RelativePath( ) { - return "..\\..\\..\\..\\SystemTest\\bin\\" + GetBuildType() + "\\net6.0\\"; + TargetFrameworkAttribute targetFramework = Assembly.GetExecutingAssembly() + .GetCustomAttributes(typeof(System.Runtime.Versioning.TargetFrameworkAttribute), false) + .SingleOrDefault() as TargetFrameworkAttribute; + + Assert.IsNotNull(targetFramework); + string working = targetFramework.FrameworkDisplayName; + if (targetFramework.FrameworkDisplayName.StartsWith('.')) + { + working = targetFramework.FrameworkDisplayName.Substring(1); + } + working = working.Replace(" ", ""); + + + return "..\\..\\..\\..\\SystemTest\\bin\\" + GetBuildType() + "\\" + working + "\\"; } private string GetBuildType() From 3d6fc63091124b2c5879bbf951dc6c885320a0ff Mon Sep 17 00:00:00 2001 From: Archie Date: Mon, 10 Mar 2025 10:04:08 -0600 Subject: [PATCH 2/2] Update all references for net 6.0 to net 8.0 --- .github/workflows/build_linux.yml | 6 +++--- .vscode/launch.json | 4 ++-- README.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 2f84cb8..9a607ca 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -22,7 +22,7 @@ jobs: runs-on: [ubuntu-latest] timeout-minutes: 30 container: - image: mcr.microsoft.com/dotnet/sdk:6.0 + image: mcr.microsoft.com/dotnet/sdk:8.0 steps: - name: Checkout source code @@ -35,13 +35,13 @@ jobs: - name: Pack artifacts run: - tar -czvf Opc2Aml.binaries.${{env.BUILD_VERSION}}.tar.gz -C ./Opc2AmlConsole/bin/Release/net6.0/ . + tar -czvf Opc2Aml.binaries.${{env.BUILD_VERSION}}.tar.gz -C ./Opc2AmlConsole/bin/Release/net8.0/ . - name: Upload artifacts uses: actions/upload-artifact@v4 with: name: Opc2Aml.binaries.${{env.BUILD_VERSION}} - path: ./Opc2AmlConsole/bin/Release/net6.0/ + path: ./Opc2AmlConsole/bin/Release/net8.0/ retention-days: 21 if-no-files-found: error diff --git a/.vscode/launch.json b/.vscode/launch.json index fca4ec1..cb37c85 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,9 +10,9 @@ "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/Opc2AmlConsole/bin/Debug/net6.0/Opc2AmlConsole.dll", + "program": "${workspaceFolder}/Opc2AmlConsole/bin/Debug/net8.0/Opc2AmlConsole.dll", "args": [], - "cwd": "${workspaceFolder}/Opc2AmlConsole/bin/Debug/net6.0/", + "cwd": "${workspaceFolder}/Opc2AmlConsole/bin/Debug/net8.0/", // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console "console": "internalConsole", "stopAtEntry": false diff --git a/README.md b/README.md index 346dafb..7535e7c 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ This C# console application that targets .NET Runtime can be built using Visual The binary releases are provided as a ZIP file. To install the binaries do the following: -1. Install the [.NET Runtime 6.0.x](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) for your platform. +1. Install the [.NET Runtime 8.0.x](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) for your platform. 2. Extract the files from the ZIP into a directory of your choice.