diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-11-13 17:46:54 -0600 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-11-13 17:46:54 -0600 |
| commit | 56339e50cc78e963b9634143af0986919cad4d43 (patch) | |
| tree | b575f1891545ac8f54a27f966048a64497be25b4 | |
| parent | 4840210789217841426e598e0b8641082d24f944 (diff) | |
| download | slskd-56339e50cc78e963b9634143af0986919cad4d43.tar.gz | |
upgrade to .net 6
| -rw-r--r-- | Dockerfile | 4 | ||||
| -rw-r--r-- | src/slskd/Common/Compute.cs | 2 | ||||
| -rw-r--r-- | src/slskd/Common/Extensions.cs | 2 | ||||
| -rw-r--r-- | src/slskd/Core/API/Controllers/ApplicationController.cs | 2 | ||||
| -rw-r--r-- | src/slskd/Integrations/FTP/FTPService.cs | 2 | ||||
| -rw-r--r-- | src/slskd/Startup.cs | 2 | ||||
| -rw-r--r-- | src/slskd/slskd.csproj | 12 | ||||
| -rw-r--r-- | tests/slskd.Tests.Integration/slskd.Tests.Integration.csproj | 2 | ||||
| -rw-r--r-- | tests/slskd.Tests.Unit/slskd.Tests.Unit.csproj | 2 |
9 files changed, 15 insertions, 15 deletions
@@ -12,7 +12,7 @@ RUN sh ./bin/build --web-only --version $VERSION # build, test, and publish application binaries # note: this needs to be pinned to an amd64 image in order to publish armv7 binaries # https://github.com/dotnet/dotnet-docker/issues/1537#issuecomment-615269150 -FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim-amd64 AS publish +FROM mcr.microsoft.com/dotnet/sdk:6.0-buster-slim-amd64 AS publish ARG TARGETPLATFORM ARG VERSION=0.0.1.65534-local @@ -31,7 +31,7 @@ RUN bash ./bin/build --dotnet-only --version $VERSION RUN bash ./bin/publish --no-prebuild --platform $TARGETPLATFORM --version $VERSION --output ../../dist/${TARGETPLATFORM} # application -FROM mcr.microsoft.com/dotnet/runtime-deps:5.0-buster-slim AS slskd +FROM mcr.microsoft.com/dotnet/runtime-deps:6.0-buster-slim AS slskd ARG TARGETPLATFORM ARG TAG=0.0.1 ARG VERSION=0.0.1.65534-local diff --git a/src/slskd/Common/Compute.cs b/src/slskd/Common/Compute.cs index 464a932d..eacaedf1 100644 --- a/src/slskd/Common/Compute.cs +++ b/src/slskd/Common/Compute.cs @@ -41,7 +41,7 @@ namespace slskd public static string Sha1Hash(string str) { - using var sha1 = new SHA1Managed(); + using var sha1 = SHA1.Create(); return BitConverter.ToString(sha1.ComputeHash(Encoding.UTF8.GetBytes(str))).Replace("-", string.Empty); } diff --git a/src/slskd/Common/Extensions.cs b/src/slskd/Common/Extensions.cs index 03bec7fe..79314389 100644 --- a/src/slskd/Common/Extensions.cs +++ b/src/slskd/Common/Extensions.cs @@ -284,7 +284,7 @@ namespace slskd var options = new JsonSerializerOptions(); options.Converters.Add(new IPAddressConverter()); options.Converters.Add(new JsonStringEnumConverter()); - options.IgnoreNullValues = true; + options.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull; return options; } } diff --git a/src/slskd/Core/API/Controllers/ApplicationController.cs b/src/slskd/Core/API/Controllers/ApplicationController.cs index a7168efb..82b1d6c5 100644 --- a/src/slskd/Core/API/Controllers/ApplicationController.cs +++ b/src/slskd/Core/API/Controllers/ApplicationController.cs @@ -119,7 +119,7 @@ namespace slskd.Core.API /// <returns></returns> [HttpPost("gc")] [Authorize] - public async Task<IActionResult> CollectGarbage() + public IActionResult CollectGarbage() { GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce; GC.Collect(2, GCCollectionMode.Forced, blocking: false, compacting: true); diff --git a/src/slskd/Integrations/FTP/FTPService.cs b/src/slskd/Integrations/FTP/FTPService.cs index dd1b340f..32b8b253 100644 --- a/src/slskd/Integrations/FTP/FTPService.cs +++ b/src/slskd/Integrations/FTP/FTPService.cs @@ -62,7 +62,7 @@ namespace slskd.Integrations.FTP { if (!FtpOptions.Enabled) { - Log.LogDebug("Skipping FTP upload of {filename}; FTP integration is disabled"); + Log.LogDebug("Skipping FTP upload of {filename}; FTP integration is disabled", filename); return; } diff --git a/src/slskd/Startup.cs b/src/slskd/Startup.cs index a8b64305..ac4a2789 100644 --- a/src/slskd/Startup.cs +++ b/src/slskd/Startup.cs @@ -169,7 +169,7 @@ namespace slskd { options.JsonSerializerOptions.Converters.Add(new IPAddressConverter()); options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()); - options.JsonSerializerOptions.IgnoreNullValues = true; + options.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull; }); services.AddSignalR().AddJsonProtocol(options => diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj index 58f7cfe0..65f6845c 100644 --- a/src/slskd/slskd.csproj +++ b/src/slskd/slskd.csproj @@ -8,7 +8,7 @@ </PropertyGroup> <PropertyGroup> - <TargetFramework>net5.0</TargetFramework> + <TargetFramework>net6.0</TargetFramework> <LangVersion>9.0</LangVersion> <CodeAnalysisRuleSet>Properties\analysis.ruleset</CodeAnalysisRuleSet> <GenerateDocumentationFile>true</GenerateDocumentationFile> @@ -43,15 +43,15 @@ <ItemGroup> <PackageReference Include="FluentFTP" Version="35.0.5" /> - <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.11" /> + <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="5.0.0" /> - <PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3"> + <PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> - <PackageReference Include="Microsoft.Data.Sqlite" Version="5.0.11" /> - <PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.11" /> - <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="5.0.11" /> + <PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.0" /> + <PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" /> + <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="6.0.0" /> <PackageReference Include="prometheus-net" Version="5.0.1" /> <PackageReference Include="prometheus-net.AspNetCore" Version="5.0.1" /> <PackageReference Include="prometheus-net.AspNetCore.HealthChecks" Version="5.0.1" /> diff --git a/tests/slskd.Tests.Integration/slskd.Tests.Integration.csproj b/tests/slskd.Tests.Integration/slskd.Tests.Integration.csproj index 89e935fa..ac1378c6 100644 --- a/tests/slskd.Tests.Integration/slskd.Tests.Integration.csproj +++ b/tests/slskd.Tests.Integration/slskd.Tests.Integration.csproj @@ -1,7 +1,7 @@ <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFramework>net5.0</TargetFramework>
+ <TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
diff --git a/tests/slskd.Tests.Unit/slskd.Tests.Unit.csproj b/tests/slskd.Tests.Unit/slskd.Tests.Unit.csproj index 569f124c..a3538c0a 100644 --- a/tests/slskd.Tests.Unit/slskd.Tests.Unit.csproj +++ b/tests/slskd.Tests.Unit/slskd.Tests.Unit.csproj @@ -1,7 +1,7 @@ <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFramework>net5.0</TargetFramework>
+ <TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
|
