Upgrade to .net 8

This commit is contained in:
2024-01-29 13:00:20 -06:00
parent 08c11b3c0e
commit 2880acb585
12 changed files with 58 additions and 63 deletions

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<EnableNETAnalyzers>true</EnableNETAnalyzers> <EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisLevel>5</AnalysisLevel> <AnalysisLevel>5</AnalysisLevel>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
@@ -23,15 +23,15 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.2.2" /> <PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.0" />
<PackageReference Include="Azure.Identity" Version="1.8.1" /> <PackageReference Include="Azure.Identity" Version="1.10.4" />
<PackageReference Include="Dapper" Version="2.0.123" /> <PackageReference Include="Dapper" Version="2.1.28" />
<PackageReference Include="FluentValidation" Version="11.4.0" /> <PackageReference Include="FluentValidation" Version="11.9.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.2" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="7.0.2" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.1" />
<PackageReference Include="Microsoft.Identity.Web" Version="1.25.10" /> <PackageReference Include="Microsoft.Identity.Web" Version="2.16.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" /> <PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<EnableNETAnalyzers>true</EnableNETAnalyzers> <EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisLevel>5</AnalysisLevel> <AnalysisLevel>5</AnalysisLevel>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings> <ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>

View File

@@ -35,7 +35,7 @@ namespace Shogi.UI.Pages.Home.Api
public async Task GuestLogout() public async Task GuestLogout()
{ {
var response = await this.guestHttpClient.PutAsync(new Uri("User/GuestLogout", UriKind.Relative), null); var response = await this.guestHttpClient.PutAsync(RelativeUri("User/TestGuestLogout"), null);
response.EnsureSuccessStatusCode(); response.EnsureSuccessStatusCode();
} }
@@ -74,7 +74,7 @@ namespace Shogi.UI.Pages.Home.Api
var content = await response.Content.ReadAsStringAsync(); var content = await response.Content.ReadAsStringAsync();
if (!string.IsNullOrEmpty(content)) if (!string.IsNullOrEmpty(content))
{ {
return await response.Content.ReadFromJsonAsync<CreateTokenResponse>(serializerOptions); return JsonSerializer.Deserialize<CreateTokenResponse>(content, serializerOptions);
} }
} }
return null; return null;

View File

@@ -7,17 +7,8 @@
@if (guestAccountDescriptionIsVisible) @if (guestAccountDescriptionIsVisible)
{ {
<h1>What&apos;s the difference?</h1> <h1>What&apos;s the difference?</h1>
@*<div class="account-description mb-4 bg-light p-2">
<h4>Feature</h4>
<h4>Guest Accounts</h4>
<h4>Email Accounts</h4>
<div>Resume in-progress games from any browser on any device.</div>
<span class="oi oi-circle-x" title="circle-x" aria-hidden="true"></span>
<span class="oi oi-circle-check" title="circle-check" aria-hidden="true"></span>
</div>*@
<p> <p>
Guest accounts are session based, meaning that the account lives exclusively within the device and browser you create the account on. Guest accounts are session based, meaning that the account lives exclusively within the device and browser you play on as a guest.
This is the only difference between guest and email accounts. This is the only difference between guest and email accounts.
</p> </p>
<div class="alert alert-warning"> <div class="alert alert-warning">

View File

@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Http.Extensions; using Microsoft.AspNetCore.WebUtilities;
using Shogi.Contracts.Socket; using Shogi.Contracts.Socket;
using Shogi.Contracts.Types; using Shogi.Contracts.Types;
using System.Buffers; using System.Buffers;
@@ -16,7 +16,7 @@ public class ShogiSocket : IDisposable
private ClientWebSocket socket; private ClientWebSocket socket;
private readonly JsonSerializerOptions serializerOptions; private readonly JsonSerializerOptions serializerOptions;
private readonly UriBuilder uriBuilder; private readonly string baseUrl;
private readonly CancellationTokenSource cancelToken; private readonly CancellationTokenSource cancelToken;
private readonly IMemoryOwner<byte> memoryOwner; private readonly IMemoryOwner<byte> memoryOwner;
private bool disposedValue; private bool disposedValue;
@@ -25,7 +25,7 @@ public class ShogiSocket : IDisposable
{ {
this.socket = new ClientWebSocket(); this.socket = new ClientWebSocket();
this.serializerOptions = serializerOptions; this.serializerOptions = serializerOptions;
this.uriBuilder = new UriBuilder(configuration["SocketUrl"] ?? throw new InvalidOperationException("SocketUrl configuration is missing.")); this.baseUrl = configuration["SocketUrl"] ?? throw new InvalidOperationException("SocketUrl configuration is missing.");
this.cancelToken = new CancellationTokenSource(); this.cancelToken = new CancellationTokenSource();
this.memoryOwner = MemoryPool<byte>.Shared.Rent(1024 * 2); this.memoryOwner = MemoryPool<byte>.Shared.Rent(1024 * 2);
} }
@@ -46,8 +46,8 @@ public class ShogiSocket : IDisposable
Console.WriteLine("Opening socket and existing socket state is " + this.socket.State.ToString()); Console.WriteLine("Opening socket and existing socket state is " + this.socket.State.ToString());
} }
uriBuilder.Query = new QueryBuilder { { "token", token } }.ToQueryString().Value; var uri = new Uri(QueryHelpers.AddQueryString(this.baseUrl, "token", token), UriKind.Absolute);
await socket.ConnectAsync(this.uriBuilder.Uri, cancelToken.Token); await socket.ConnectAsync(uri, cancelToken.Token);
// Fire and forget! I'm way too lazy to write my own javascript interop to a web worker. Nooo thanks. // Fire and forget! I'm way too lazy to write my own javascript interop to a web worker. Nooo thanks.
_ = Listen() _ = Listen()
.ContinueWith(async antecedent => .ContinueWith(async antecedent =>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly"> <Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup> </PropertyGroup>
@@ -14,12 +14,12 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.2" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.2" PrivateAssets="all" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="7.0.2" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="8.0.1" />
<PackageReference Include="Microsoft.Authentication.WebAssembly.Msal" Version="7.0.2" /> <PackageReference Include="Microsoft.Authentication.WebAssembly.Msal" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -12,8 +12,9 @@
"api://c1e94676-cab0-42ba-8b6c-9532b8486fff/DefaultScope" "api://c1e94676-cab0-42ba-8b6c-9532b8486fff/DefaultScope"
] ]
}, },
"ShogiApiUrl2": "https://localhost:5001",
"ShogiApiUrl": "https://api.lucaserver.space/Shogi.Api/", "ShogiApiUrl": "https://api.lucaserver.space/Shogi.Api/",
"SocketUrl": "wss://api.lucaserver.space/Shogi.Api/", "SocketUrl": "wss://api.lucaserver.space/Shogi.Api/",
"ShogiApiUrl2": "https://localhost:5001",
"SocketUrl2": "wss://localhost:5001" "SocketUrl2": "wss://localhost:5001"
} }

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
@@ -21,21 +21,21 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.9.0" /> <PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.2" /> <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.49.1" /> <PackageReference Include="Microsoft.Identity.Client" Version="4.59.0" />
<PackageReference Include="Microsoft.Net.Http.Headers" Version="2.2.8" /> <PackageReference Include="Microsoft.Net.Http.Headers" Version="8.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.4.2" /> <PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> <PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0"> <PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
@@ -9,12 +9,15 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.Playwright.NUnit" Version="1.30.0" /> <PackageReference Include="Microsoft.Playwright.NUnit" Version="1.41.1" />
<PackageReference Include="NUnit" Version="3.13.3" /> <PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.3.0" /> <PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.5.0" /> <PackageReference Include="NUnit.Analyzers" Version="3.10.0">
<PackageReference Include="coverlet.collector" Version="3.2.0"> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

View File

@@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.9.0" /> <PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.4.2" /> <PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> <PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0"> <PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>

View File

@@ -1,6 +1,6 @@
{ {
"sdk": { "sdk": {
"version": "7.0.2", "version": "8.0.0",
"rollForward": "latestFeature" "rollForward": "latestFeature"
} }
} }