From 2a4978ca5163e388894c763bbd2b0bb80a284b99 Mon Sep 17 00:00:00 2001 From: Qiu Hao Date: Sun, 18 Feb 2024 21:01:47 +0800 Subject: [PATCH] upgrade to .net8.0 --- .github/workflows/dotnet.yml | 6 ++---- .github/workflows/master_webssh_deploy.yml | 2 +- src/WebSSH.Playground/WebSSH.Playground.csproj | 6 +++--- src/WebSSH.Test/Shared/ActiveSessionsModelTest.cs | 9 +++++---- .../Shared/ClientStoredSessionsModelTest.cs | 11 ++++++----- src/WebSSH.Test/WebSSH.Test.csproj | 10 +++++----- src/WebSSH/Client/WebSSH.Client.csproj | 10 +++++----- src/WebSSH/Server/Common/CaptchaImageUtils.cs | 4 ++-- src/WebSSH/Server/WebSSH.Server.csproj | 12 ++++++------ src/WebSSH/Shared/WebSSH.Shared.csproj | 4 ++-- 10 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 6c5303b..0710eab 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -3,8 +3,6 @@ name: .NET publish and test on: push: branches: [ master ] - pull_request: - branches: [ master ] jobs: build: @@ -13,10 +11,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Setup .NET 7 + - name: Setup .NET 8 uses: actions/setup-dotnet@v1 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Install dependencies run: | cd src diff --git a/.github/workflows/master_webssh_deploy.yml b/.github/workflows/master_webssh_deploy.yml index 0b384ef..4b84729 100644 --- a/.github/workflows/master_webssh_deploy.yml +++ b/.github/workflows/master_webssh_deploy.yml @@ -19,7 +19,7 @@ jobs: - name: Set up .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: '7.0.x' + dotnet-version: '8.0.x' include-prerelease: true - name: Build with dotnet diff --git a/src/WebSSH.Playground/WebSSH.Playground.csproj b/src/WebSSH.Playground/WebSSH.Playground.csproj index e14fdf0..53a1c58 100644 --- a/src/WebSSH.Playground/WebSSH.Playground.csproj +++ b/src/WebSSH.Playground/WebSSH.Playground.csproj @@ -1,15 +1,15 @@  - net7.0 + net8.0 latest Exe f47a4a51-8924-4851-9560-0d518ebdf5e7 - - + + diff --git a/src/WebSSH.Test/Shared/ActiveSessionsModelTest.cs b/src/WebSSH.Test/Shared/ActiveSessionsModelTest.cs index db2d863..42e17c2 100644 --- a/src/WebSSH.Test/Shared/ActiveSessionsModelTest.cs +++ b/src/WebSSH.Test/Shared/ActiveSessionsModelTest.cs @@ -1,5 +1,6 @@ using System; using NUnit.Framework; +using NUnit.Framework.Legacy; using WebSSH.Shared; namespace WebSSH.Test @@ -11,7 +12,7 @@ public void TestAddActiveSession() { var model = new ActiveSessionsModel(); model.AddActiveSession(new ActiveSessionModel()); - Assert.AreEqual(1, model.Sessions.Count); + ClassicAssert.AreEqual(1, model.Sessions.Count); } [Test] @@ -20,13 +21,13 @@ public void TestRemoveActiveSession() var sessionModel = new ActiveSessionModel(); var model = new ActiveSessionsModel(); model.AddActiveSession(sessionModel); - Assert.AreEqual(1, model.Sessions.Count); + ClassicAssert.AreEqual(1, model.Sessions.Count); model.RemoveActiveSession(Guid.NewGuid()); - Assert.AreEqual(1, model.Sessions.Count); + ClassicAssert.AreEqual(1, model.Sessions.Count); model.RemoveActiveSession(sessionModel.UniqueKey); - Assert.AreEqual(0, model.Sessions.Count); + ClassicAssert.AreEqual(0, model.Sessions.Count); } } } diff --git a/src/WebSSH.Test/Shared/ClientStoredSessionsModelTest.cs b/src/WebSSH.Test/Shared/ClientStoredSessionsModelTest.cs index 02d1c1a..541c83e 100644 --- a/src/WebSSH.Test/Shared/ClientStoredSessionsModelTest.cs +++ b/src/WebSSH.Test/Shared/ClientStoredSessionsModelTest.cs @@ -1,5 +1,6 @@ using System; using NUnit.Framework; +using NUnit.Framework.Legacy; using WebSSH.Shared; namespace WebSSH.Test @@ -10,10 +11,10 @@ public class ClientStoredSessionsModelTest public void TestAddOrUpdateStoredSessions() { var storedSessionsModel = new ClientStoredSessionsModel(); - Assert.AreEqual(0, storedSessionsModel.Sessions.Count); + ClassicAssert.AreEqual(0, storedSessionsModel.Sessions.Count); storedSessionsModel.AddOrUpdateStoredSessions(new ClientStoredSessionModel()); - Assert.AreEqual(1, storedSessionsModel.Sessions.Count); + ClassicAssert.AreEqual(1, storedSessionsModel.Sessions.Count); } [Test] @@ -22,13 +23,13 @@ public void TestRemoveStoredSessions() var sessionModel = new ClientStoredSessionModel(); var storedSessionsModel = new ClientStoredSessionsModel(); storedSessionsModel.AddOrUpdateStoredSessions(sessionModel); - Assert.AreEqual(1, storedSessionsModel.Sessions.Count); + ClassicAssert.AreEqual(1, storedSessionsModel.Sessions.Count); storedSessionsModel.RemoveStoredSession(Guid.NewGuid()); - Assert.AreEqual(1, storedSessionsModel.Sessions.Count); + ClassicAssert.AreEqual(1, storedSessionsModel.Sessions.Count); storedSessionsModel.RemoveStoredSession(sessionModel.UniqueKey); - Assert.AreEqual(0, storedSessionsModel.Sessions.Count); + ClassicAssert.AreEqual(0, storedSessionsModel.Sessions.Count); } } } diff --git a/src/WebSSH.Test/WebSSH.Test.csproj b/src/WebSSH.Test/WebSSH.Test.csproj index d02e25c..8e18f37 100644 --- a/src/WebSSH.Test/WebSSH.Test.csproj +++ b/src/WebSSH.Test/WebSSH.Test.csproj @@ -1,15 +1,15 @@ - + - net7.0 + net8.0 latest false - - - + + + diff --git a/src/WebSSH/Client/WebSSH.Client.csproj b/src/WebSSH/Client/WebSSH.Client.csproj index d8ea071..f99744f 100644 --- a/src/WebSSH/Client/WebSSH.Client.csproj +++ b/src/WebSSH/Client/WebSSH.Client.csproj @@ -1,18 +1,18 @@  - net7.0 + net8.0 latest 3.0 service-worker-assets.js - - - + + + - + diff --git a/src/WebSSH/Server/Common/CaptchaImageUtils.cs b/src/WebSSH/Server/Common/CaptchaImageUtils.cs index 8c90930..a037148 100644 --- a/src/WebSSH/Server/Common/CaptchaImageUtils.cs +++ b/src/WebSSH/Server/Common/CaptchaImageUtils.cs @@ -83,10 +83,10 @@ static void DrawDisorderLine(int width, int height, Image graphics, Random rando { for (int i = 0; i < random.Next(3, 5); i++) { - var linePen = new Pen(new SolidBrush(GetRandomLightColor(random)), 3); + var linePen = new SolidPen(new SolidBrush(GetRandomLightColor(random)), 3); var startPoint = new Point(random.Next(0, width), random.Next(0, height)); var endPoint = new Point(random.Next(0, width), random.Next(0, height)); - graphics.Mutate(operation => operation.DrawLines(linePen, startPoint, endPoint)); + graphics.Mutate(operation => operation.DrawLine(linePen, startPoint, endPoint)); //var bezierPoint1 = new Point(random.Next(0, width), random.Next(0, height)); //var bezierPoint2 = new Point(random.Next(0, width), random.Next(0, height)); diff --git a/src/WebSSH/Server/WebSSH.Server.csproj b/src/WebSSH/Server/WebSSH.Server.csproj index 3806375..e88e153 100644 --- a/src/WebSSH/Server/WebSSH.Server.csproj +++ b/src/WebSSH/Server/WebSSH.Server.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 latest 17b0f966-6e00-43b0-98df-5d0a114de927 Linux @@ -9,11 +9,11 @@ - - - - - + + + + + diff --git a/src/WebSSH/Shared/WebSSH.Shared.csproj b/src/WebSSH/Shared/WebSSH.Shared.csproj index edfa3ea..a9495de 100644 --- a/src/WebSSH/Shared/WebSSH.Shared.csproj +++ b/src/WebSSH/Shared/WebSSH.Shared.csproj @@ -1,12 +1,12 @@  - netstandard2.1 + net8.0 latest - +