Skip to content

Commit 6e4bb74

Browse files
Upgrade to net 8.0 (#103)
* Upgrade to net 8.0 * Update all references for net 6.0 to net 8.0
1 parent 4485956 commit 6e4bb74

File tree

7 files changed

+25
-10
lines changed

7 files changed

+25
-10
lines changed

.github/workflows/build_linux.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: [ubuntu-latest]
2323
timeout-minutes: 30
2424
container:
25-
image: mcr.microsoft.com/dotnet/sdk:6.0
25+
image: mcr.microsoft.com/dotnet/sdk:8.0
2626

2727
steps:
2828
- name: Checkout source code
@@ -35,13 +35,13 @@ jobs:
3535

3636
- name: Pack artifacts
3737
run:
38-
tar -czvf Opc2Aml.binaries.${{env.BUILD_VERSION}}.tar.gz -C ./Opc2AmlConsole/bin/Release/net6.0/ .
38+
tar -czvf Opc2Aml.binaries.${{env.BUILD_VERSION}}.tar.gz -C ./Opc2AmlConsole/bin/Release/net8.0/ .
3939

4040
- name: Upload artifacts
4141
uses: actions/upload-artifact@v4
4242
with:
4343
name: Opc2Aml.binaries.${{env.BUILD_VERSION}}
44-
path: ./Opc2AmlConsole/bin/Release/net6.0/
44+
path: ./Opc2AmlConsole/bin/Release/net8.0/
4545
retention-days: 21
4646
if-no-files-found: error
4747

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"request": "launch",
1111
"preLaunchTask": "build",
1212
// If you have changed target frameworks, make sure to update the program path.
13-
"program": "${workspaceFolder}/Opc2AmlConsole/bin/Debug/net6.0/Opc2AmlConsole.dll",
13+
"program": "${workspaceFolder}/Opc2AmlConsole/bin/Debug/net8.0/Opc2AmlConsole.dll",
1414
"args": [],
15-
"cwd": "${workspaceFolder}/Opc2AmlConsole/bin/Debug/net6.0/",
15+
"cwd": "${workspaceFolder}/Opc2AmlConsole/bin/Debug/net8.0/",
1616
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
1717
"console": "internalConsole",
1818
"stopAtEntry": false

Opc2Aml.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<StartupObject></StartupObject>
77
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
88
<Deterministic>false</Deterministic>

Opc2AmlConsole/Opc2AmlConsole.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This C# console application that targets .NET Runtime can be built using Visual
2626

2727
The binary releases are provided as a ZIP file. To install the binaries do the following:
2828

29-
1. Install the [.NET Runtime 6.0.x](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) for your platform.
29+
1. Install the [.NET Runtime 8.0.x](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) for your platform.
3030

3131
2. Extract the files from the ZIP into a directory of your choice.
3232

SystemTest/SystemTest.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66

77
<IsPackable>false</IsPackable>

SystemTest/TestCommandLine.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
using System.Diagnostics;
55
using System.IO;
66
using System.Linq;
7+
using System.Reflection;
8+
using System.Runtime.Versioning;
79
using System.Text;
810
using System.Threading.Tasks;
911
using static Org.BouncyCastle.Math.EC.ECCurve;
@@ -332,7 +334,20 @@ private string ConfigDirectoryString()
332334

333335
private string RelativePath( )
334336
{
335-
return "..\\..\\..\\..\\SystemTest\\bin\\" + GetBuildType() + "\\net6.0\\";
337+
TargetFrameworkAttribute targetFramework = Assembly.GetExecutingAssembly()
338+
.GetCustomAttributes(typeof(System.Runtime.Versioning.TargetFrameworkAttribute), false)
339+
.SingleOrDefault() as TargetFrameworkAttribute;
340+
341+
Assert.IsNotNull(targetFramework);
342+
string working = targetFramework.FrameworkDisplayName;
343+
if (targetFramework.FrameworkDisplayName.StartsWith('.'))
344+
{
345+
working = targetFramework.FrameworkDisplayName.Substring(1);
346+
}
347+
working = working.Replace(" ", "");
348+
349+
350+
return "..\\..\\..\\..\\SystemTest\\bin\\" + GetBuildType() + "\\" + working + "\\";
336351
}
337352

338353
private string GetBuildType()

0 commit comments

Comments
 (0)