From 6b926270042e4bdd30c58409f9ef8db1a82b63de Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 1 May 2024 18:25:43 +0300 Subject: [PATCH] New: Bump to .NET 8 --- .devcontainer/devcontainer.json | 4 +- .github/actions/package/package.sh | 2 +- .github/workflows/build.yml | 2 +- .vscode/launch.json | 2 +- build.sh | 6 +- distribution/windows/setup/build.bat | 2 +- docs.sh | 2 +- global.json | 2 +- package.json | 2 +- src/Directory.Build.props | 13 +--- src/NzbDrone.Api.Test/Sonarr.Api.Test.csproj | 4 +- .../Sonarr.Automation.Test.csproj | 4 +- .../Sonarr.Common.Test.csproj | 4 +- .../Disk/DestinationAlreadyExistsException.cs | 6 -- .../EnvironmentInfo/AppFolderFactory.cs | 2 +- src/NzbDrone.Common/Sonarr.Common.csproj | 12 ++-- src/NzbDrone.Console/Sonarr.Console.csproj | 2 +- .../Sonarr.Core.Test.csproj | 6 +- .../EpisodeImport/RecycleBinException.cs | 6 -- .../RootFolderNotFoundException.cs | 6 -- src/NzbDrone.Core/Sonarr.Core.csproj | 20 +++---- .../Sonarr.Host.Test.csproj | 4 +- src/NzbDrone.Host/Sonarr.Host.csproj | 7 +-- .../Sonarr.Integration.Test.csproj | 6 +- .../Sonarr.Libraries.Test.csproj | 4 +- .../Sonarr.Mono.Test.csproj | 4 +- src/NzbDrone.Mono/Sonarr.Mono.csproj | 2 +- src/NzbDrone.SignalR/Sonarr.SignalR.csproj | 2 +- src/NzbDrone.Test.Common/NzbDroneRunner.cs | 2 +- .../Sonarr.Test.Common.csproj | 6 +- .../Sonarr.Test.Dummy.csproj | 2 +- .../Sonarr.Update.Test.csproj | 4 +- src/NzbDrone.Update/Sonarr.Update.csproj | 2 +- .../Sonarr.Windows.Test.csproj | 4 +- src/NzbDrone.Windows/Sonarr.Windows.csproj | 2 +- src/NzbDrone/Sonarr.csproj | 4 +- .../ServiceInstall/ServiceInstall.csproj | 2 +- .../ServiceUninstall/ServiceUninstall.csproj | 2 +- src/Sonarr.Api.V3/Queue/QueueController.cs | 8 +-- src/Sonarr.Api.V3/Sonarr.Api.V3.csproj | 2 +- .../ApiKeyAuthenticationHandler.cs | 3 +- .../BasicAuthenticationHandler.cs | 7 +-- .../Authentication/NoAuthenticationHandler.cs | 5 +- .../Middleware/VersionMiddleware.cs | 2 +- src/Sonarr.Http/REST/RestController.cs | 2 +- src/Sonarr.Http/Sonarr.Http.csproj | 4 +- .../Sonarr.RuntimePatches.csproj | 2 +- test.sh | 7 ++- yarn.lock | 59 +++++++++++++------ 49 files changed, 132 insertions(+), 137 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 629a2aa21..c84df5d64 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,11 +2,11 @@ // README at: https://github.com/devcontainers/templates/tree/main/src/dotnet { "name": "Sonarr", - "image": "mcr.microsoft.com/devcontainers/dotnet:1-6.0", + "image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0", "features": { "ghcr.io/devcontainers/features/node:1": { "nodeGypDependencies": true, - "version": "16", + "version": "20", "nvmVersion": "latest" } }, diff --git a/.github/actions/package/package.sh b/.github/actions/package/package.sh index 8dce60585..4c3c8a8ba 100755 --- a/.github/actions/package/package.sh +++ b/.github/actions/package/package.sh @@ -3,7 +3,7 @@ outputFolder=_output artifactsFolder=_artifacts uiFolder="$outputFolder/UI" -framework="${FRAMEWORK:=net6.0}" +framework="${FRAMEWORK:=net8.0}" rm -rf $artifactsFolder mkdir $artifactsFolder diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1806d68f1..6947e297e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ concurrency: cancel-in-progress: true env: - FRAMEWORK: net6.0 + FRAMEWORK: net8.0 RAW_BRANCH_NAME: ${{ github.head_ref || github.ref_name }} SONARR_MAJOR_VERSION: 4 VERSION: 4.0.13 diff --git a/.vscode/launch.json b/.vscode/launch.json index 6ea80f418..4e4c3440d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,7 +10,7 @@ "request": "launch", "preLaunchTask": "build dotnet", // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/_output/net6.0/Sonarr", + "program": "${workspaceFolder}/_output/net8.0/Sonarr", "args": [], "cwd": "${workspaceFolder}", // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console diff --git a/build.sh b/build.sh index ee59d2f61..29908e8cf 100755 --- a/build.sh +++ b/build.sh @@ -4,7 +4,7 @@ set -e outputFolder='_output' testPackageFolder='_tests' artifactsFolder="_artifacts"; -framework="${FRAMEWORK:=net6.0}" +framework="${FRAMEWORK:=net8.0}" ProgressStart() { @@ -77,9 +77,9 @@ Build() if [[ -z "$RID" || -z "$FRAMEWORK" ]]; then - dotnet msbuild -restore $slnFile -p:Configuration=Release -p:Platform=$platform -t:PublishAllRids + dotnet msbuild -restore $slnFile -p:SelfContained=True -p:Configuration=Release -p:Platform=$platform -t:PublishAllRids else - dotnet msbuild -restore $slnFile -p:Configuration=Release -p:Platform=$platform -p:RuntimeIdentifiers=$RID -t:PublishAllRids + dotnet msbuild -restore $slnFile -p:SelfContained=True -p:Configuration=Release -p:Platform=$platform -p:RuntimeIdentifiers=$RID -t:PublishAllRids fi ProgressEnd 'Build' diff --git a/distribution/windows/setup/build.bat b/distribution/windows/setup/build.bat index 6c205089e..0d6b89d23 100644 --- a/distribution/windows/setup/build.bat +++ b/distribution/windows/setup/build.bat @@ -1,7 +1,7 @@ @REM SET SONARR_MAJOR_VERSION=4 @REM SET SONARR_VERSION=4.0.0.5 @REM SET BRANCH=develop -@REM SET FRAMEWORK=net6.0 +@REM SET FRAMEWORK=net8.0 @REM SET RUNTIME=win-x64 inno\ISCC.exe sonarr.iss diff --git a/docs.sh b/docs.sh index 386f5df68..0f3733f4e 100755 --- a/docs.sh +++ b/docs.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -FRAMEWORK="net6.0" +FRAMEWORK="net8.0" PLATFORM=$1 if [ "$PLATFORM" = "Windows" ]; then diff --git a/global.json b/global.json index 5f5ece165..13d185e52 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "6.0.405" + "version": "8.0.405" } } diff --git a/package.json b/package.json index b730e784e..c36955e63 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "@fortawesome/free-solid-svg-icons": "6.7.1", "@fortawesome/react-fontawesome": "0.2.2", "@juggle/resize-observer": "3.4.0", - "@microsoft/signalr": "6.0.21", + "@microsoft/signalr": "8.0.7", "@sentry/browser": "7.119.1", "@tanstack/react-query": "5.61.0", "@types/node": "20.16.11", diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 239a98d73..688007114 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -98,13 +98,6 @@ $(MSBuildProjectName.Replace('Sonarr','NzbDrone')) - - - - - - - @@ -129,13 +122,13 @@ - - + + - + diff --git a/src/NzbDrone.Api.Test/Sonarr.Api.Test.csproj b/src/NzbDrone.Api.Test/Sonarr.Api.Test.csproj index 053b42cc9..3a47bdcc4 100644 --- a/src/NzbDrone.Api.Test/Sonarr.Api.Test.csproj +++ b/src/NzbDrone.Api.Test/Sonarr.Api.Test.csproj @@ -1,9 +1,9 @@  - net6.0 + net8.0 - + diff --git a/src/NzbDrone.Automation.Test/Sonarr.Automation.Test.csproj b/src/NzbDrone.Automation.Test/Sonarr.Automation.Test.csproj index 9cf833789..2317dc060 100644 --- a/src/NzbDrone.Automation.Test/Sonarr.Automation.Test.csproj +++ b/src/NzbDrone.Automation.Test/Sonarr.Automation.Test.csproj @@ -1,9 +1,9 @@  - net6.0 + net8.0 - + diff --git a/src/NzbDrone.Common.Test/Sonarr.Common.Test.csproj b/src/NzbDrone.Common.Test/Sonarr.Common.Test.csproj index 402cae2bf..0116645bc 100644 --- a/src/NzbDrone.Common.Test/Sonarr.Common.Test.csproj +++ b/src/NzbDrone.Common.Test/Sonarr.Common.Test.csproj @@ -1,9 +1,9 @@  - net6.0 + net8.0 - + diff --git a/src/NzbDrone.Common/Disk/DestinationAlreadyExistsException.cs b/src/NzbDrone.Common/Disk/DestinationAlreadyExistsException.cs index ffdc36e0e..d96bb22e9 100644 --- a/src/NzbDrone.Common/Disk/DestinationAlreadyExistsException.cs +++ b/src/NzbDrone.Common/Disk/DestinationAlreadyExistsException.cs @@ -1,6 +1,5 @@ using System; using System.IO; -using System.Runtime.Serialization; namespace NzbDrone.Common.Disk { @@ -24,10 +23,5 @@ namespace NzbDrone.Common.Disk : base(message, innerException) { } - - protected DestinationAlreadyExistsException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } } } diff --git a/src/NzbDrone.Common/EnvironmentInfo/AppFolderFactory.cs b/src/NzbDrone.Common/EnvironmentInfo/AppFolderFactory.cs index 38b0916f5..9a0afedaf 100644 --- a/src/NzbDrone.Common/EnvironmentInfo/AppFolderFactory.cs +++ b/src/NzbDrone.Common/EnvironmentInfo/AppFolderFactory.cs @@ -134,7 +134,7 @@ namespace NzbDrone.Common.EnvironmentInfo catch (Exception ex) { _logger.Debug(ex, ex.Message); - throw new SonarrStartupException("Unable to migrate AppData folder from {0} to {1}. Migrate manually", _appFolderInfo.LegacyAppDataFolder, _appFolderInfo.AppDataFolder); + throw new SonarrStartupException(ex, "Unable to migrate AppData folder from {0} to {1}. Migrate manually", _appFolderInfo.LegacyAppDataFolder, _appFolderInfo.AppDataFolder); } } diff --git a/src/NzbDrone.Common/Sonarr.Common.csproj b/src/NzbDrone.Common/Sonarr.Common.csproj index 16fe75f18..34193a16c 100644 --- a/src/NzbDrone.Common/Sonarr.Common.csproj +++ b/src/NzbDrone.Common/Sonarr.Common.csproj @@ -1,13 +1,13 @@  - net6.0 + net8.0 ISMUSL - - + + @@ -15,13 +15,13 @@ - + - + - + diff --git a/src/NzbDrone.Console/Sonarr.Console.csproj b/src/NzbDrone.Console/Sonarr.Console.csproj index aef81527d..c383c33be 100644 --- a/src/NzbDrone.Console/Sonarr.Console.csproj +++ b/src/NzbDrone.Console/Sonarr.Console.csproj @@ -1,7 +1,7 @@  Exe - net6.0 + net8.0 ..\NzbDrone.Host\Sonarr.ico diff --git a/src/NzbDrone.Core.Test/Sonarr.Core.Test.csproj b/src/NzbDrone.Core.Test/Sonarr.Core.Test.csproj index 6a1477da4..3b8a910d7 100644 --- a/src/NzbDrone.Core.Test/Sonarr.Core.Test.csproj +++ b/src/NzbDrone.Core.Test/Sonarr.Core.Test.csproj @@ -1,10 +1,10 @@  - net6.0 + net8.0 - - + + diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/RecycleBinException.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/RecycleBinException.cs index 645951518..9586d0e63 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/RecycleBinException.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/RecycleBinException.cs @@ -1,6 +1,5 @@ using System; using System.IO; -using System.Runtime.Serialization; namespace NzbDrone.Core.MediaFiles.EpisodeImport { @@ -19,10 +18,5 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport : base(message, innerException) { } - - protected RecycleBinException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } } } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/RootFolderNotFoundException.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/RootFolderNotFoundException.cs index 9690a4028..07aebc9bc 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/RootFolderNotFoundException.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/RootFolderNotFoundException.cs @@ -1,6 +1,5 @@ using System; using System.IO; -using System.Runtime.Serialization; namespace NzbDrone.Core.MediaFiles.EpisodeImport { @@ -19,10 +18,5 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport : base(message, innerException) { } - - protected RootFolderNotFoundException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } } } diff --git a/src/NzbDrone.Core/Sonarr.Core.csproj b/src/NzbDrone.Core/Sonarr.Core.csproj index 2b2ec9042..be270d55e 100644 --- a/src/NzbDrone.Core/Sonarr.Core.csproj +++ b/src/NzbDrone.Core/Sonarr.Core.csproj @@ -1,21 +1,21 @@ - net6.0 + net8.0 - + - - + + - + - - - + + + @@ -25,8 +25,8 @@ - - + + diff --git a/src/NzbDrone.Host.Test/Sonarr.Host.Test.csproj b/src/NzbDrone.Host.Test/Sonarr.Host.Test.csproj index 00783be18..38a1989bf 100644 --- a/src/NzbDrone.Host.Test/Sonarr.Host.Test.csproj +++ b/src/NzbDrone.Host.Test/Sonarr.Host.Test.csproj @@ -1,9 +1,9 @@  - net6.0 + net8.0 - + diff --git a/src/NzbDrone.Host/Sonarr.Host.csproj b/src/NzbDrone.Host/Sonarr.Host.csproj index 322e345c5..916085933 100644 --- a/src/NzbDrone.Host/Sonarr.Host.csproj +++ b/src/NzbDrone.Host/Sonarr.Host.csproj @@ -1,14 +1,13 @@  - net6.0 + net8.0 Library - - - + + diff --git a/src/NzbDrone.Integration.Test/Sonarr.Integration.Test.csproj b/src/NzbDrone.Integration.Test/Sonarr.Integration.Test.csproj index b78253880..4e7451429 100644 --- a/src/NzbDrone.Integration.Test/Sonarr.Integration.Test.csproj +++ b/src/NzbDrone.Integration.Test/Sonarr.Integration.Test.csproj @@ -1,11 +1,11 @@  - net6.0 + net8.0 Library - - + + diff --git a/src/NzbDrone.Libraries.Test/Sonarr.Libraries.Test.csproj b/src/NzbDrone.Libraries.Test/Sonarr.Libraries.Test.csproj index 511c54cba..800aecd18 100644 --- a/src/NzbDrone.Libraries.Test/Sonarr.Libraries.Test.csproj +++ b/src/NzbDrone.Libraries.Test/Sonarr.Libraries.Test.csproj @@ -1,9 +1,9 @@  - net6.0 + net8.0 - + diff --git a/src/NzbDrone.Mono.Test/Sonarr.Mono.Test.csproj b/src/NzbDrone.Mono.Test/Sonarr.Mono.Test.csproj index 60c6f901c..d4c0a33be 100644 --- a/src/NzbDrone.Mono.Test/Sonarr.Mono.Test.csproj +++ b/src/NzbDrone.Mono.Test/Sonarr.Mono.Test.csproj @@ -1,13 +1,13 @@  - net6.0 + net8.0 - + diff --git a/src/NzbDrone.Mono/Sonarr.Mono.csproj b/src/NzbDrone.Mono/Sonarr.Mono.csproj index 7901ccd16..ec9e47f03 100644 --- a/src/NzbDrone.Mono/Sonarr.Mono.csproj +++ b/src/NzbDrone.Mono/Sonarr.Mono.csproj @@ -1,6 +1,6 @@  - net6.0 + net8.0 true