Skip to content

Commit

Permalink
upgrade to .net8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuhaotc committed Feb 18, 2024
1 parent 4e59fb9 commit 2a4978c
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 37 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: .NET publish and test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master_webssh_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/WebSSH.Playground/WebSSH.Playground.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<OutputType>Exe</OutputType>
<UserSecretsId>f47a4a51-8924-4851-9560-0d518ebdf5e7</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="SSH.NET" Version="2020.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="SSH.NET" Version="2023.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 5 additions & 4 deletions src/WebSSH.Test/Shared/ActiveSessionsModelTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using NUnit.Framework;
using NUnit.Framework.Legacy;
using WebSSH.Shared;

namespace WebSSH.Test
Expand All @@ -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]
Expand All @@ -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);
}
}
}
11 changes: 6 additions & 5 deletions src/WebSSH.Test/Shared/ClientStoredSessionsModelTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using NUnit.Framework;
using NUnit.Framework.Legacy;
using WebSSH.Shared;

namespace WebSSH.Test
Expand All @@ -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]
Expand All @@ -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);
}
}
}
10 changes: 5 additions & 5 deletions src/WebSSH.Test/WebSSH.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="nunit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions src/WebSSH/Client/WebSSH.Client.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="4.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.5" PrivateAssets="all" />
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.2.0" />
<PackageReference Include="System.Net.Http.Json" Version="7.0.1" />
<PackageReference Include="System.Net.Http.Json" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/WebSSH/Server/Common/CaptchaImageUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
12 changes: 6 additions & 6 deletions src/WebSSH/Server/WebSSH.Server.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<UserSecretsId>17b0f966-6e00-43b0-98df-5d0a114de927</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..</DockerfileContext>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="7.0.5" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" />
<PackageReference Include="SSH.NET" Version="2020.0.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.1" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta15" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.2" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
<PackageReference Include="SSH.NET" Version="2023.0.1" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.2" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/WebSSH/Shared/WebSSH.Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="7.0.2" />
<PackageReference Include="System.Text.Json" Version="8.0.2" />
</ItemGroup>

</Project>

0 comments on commit 2a4978c

Please sign in to comment.