Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to net 8.0 #103

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Opc2Aml.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<StartupObject></StartupObject>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Deterministic>false</Deterministic>
Expand Down
2 changes: 1 addition & 1 deletion Opc2AmlConsole/Opc2AmlConsole.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion SystemTest/SystemTest.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
Expand Down
17 changes: 16 additions & 1 deletion SystemTest/TestCommandLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()
Expand Down