From c78d092be54271b4d806c31bb499b6f5bec27f03 Mon Sep 17 00:00:00 2001 From: Aytac Kirmizi Date: Mon, 4 Mar 2024 18:29:11 +0100 Subject: [PATCH] **update** migrated to .NET 8 --- README.md | 2 +- global.json | 2 +- src/Domain/Core/Core.csproj | 6 +++--- src/Linkding/Linkding.csproj | 6 +++--- .../Extensions/ServiceRegistrationExtensions.cs | 7 ++++--- .../Linkding.Client/Linkding.Client.csproj | 15 +++++++-------- .../Extensions/ServiceRegistrationExtensions.cs | 6 ++++-- .../Wallabag.Client/Wallabag.Client.csproj | 12 ++++++------ src/Wallabag/Wallabag.csproj | 8 ++++---- 9 files changed, 33 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 9834daa..279d6fc 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ LinkdingSync is a collection of tools that make life with [Linkding](https://git One of the workers is for syncing to [Wallabag](https://wallabag.org/en). ## Getting Started -It is recommended to use the Docker images. Otherwise, a .NET 6 environment is required to customize and build the code. +It is recommended to use the Docker images. Otherwise, a .NET 8 environment is required to customize and build the code. ## Environment Variables For the containers to work, the environment variables must be passed. This can be done either directly via the Docker run **-e** switch, via the **environment** settings in a Docker compose definition, or via an environment variable file. diff --git a/global.json b/global.json index 1bcf6c0..2ddda36 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.0", + "version": "8.0.0", "rollForward": "latestMinor", "allowPrerelease": false } diff --git a/src/Domain/Core/Core.csproj b/src/Domain/Core/Core.csproj index 7f2e911..7776d67 100644 --- a/src/Domain/Core/Core.csproj +++ b/src/Domain/Core/Core.csproj @@ -6,9 +6,9 @@ - - - + + + diff --git a/src/Linkding/Linkding.csproj b/src/Linkding/Linkding.csproj index 3d17ada..a45ddcd 100644 --- a/src/Linkding/Linkding.csproj +++ b/src/Linkding/Linkding.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable enable dotnet-LinkdingService-80165DE2-FA70-4803-B366-DF8F24CF86BE @@ -9,8 +9,8 @@ - - + + diff --git a/src/Services/Linkding.Client/Extensions/ServiceRegistrationExtensions.cs b/src/Services/Linkding.Client/Extensions/ServiceRegistrationExtensions.cs index 7858b51..178db6d 100644 --- a/src/Services/Linkding.Client/Extensions/ServiceRegistrationExtensions.cs +++ b/src/Services/Linkding.Client/Extensions/ServiceRegistrationExtensions.cs @@ -1,4 +1,4 @@ -using System.Net.Http.Headers; +using System.Reflection; using Linkding.Client; using Linkding.Client.Options; using Microsoft.Extensions.Configuration; @@ -18,8 +18,9 @@ public static class ServiceRegistrationExtensions services.AddHttpClient() .SetHandlerLifetime(TimeSpan.FromMinutes(5)) //Set lifetime to five minutes .AddPolicyHandler(GetRetryPolicy()); - - services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies()); + + var assemblies = AppDomain.CurrentDomain.GetAssemblies(); + services.AddAutoMapper(assemblies); return services; } diff --git a/src/Services/Linkding.Client/Linkding.Client.csproj b/src/Services/Linkding.Client/Linkding.Client.csproj index 8a97f10..9e5d044 100644 --- a/src/Services/Linkding.Client/Linkding.Client.csproj +++ b/src/Services/Linkding.Client/Linkding.Client.csproj @@ -1,20 +1,19 @@ - net6.0 + net8.0 enable enable AnyCPU - - - - - - - + + + + + + diff --git a/src/Services/Wallabag.Client/Extensions/ServiceRegistrationExtensions.cs b/src/Services/Wallabag.Client/Extensions/ServiceRegistrationExtensions.cs index e6ac3ff..3ea0b75 100644 --- a/src/Services/Wallabag.Client/Extensions/ServiceRegistrationExtensions.cs +++ b/src/Services/Wallabag.Client/Extensions/ServiceRegistrationExtensions.cs @@ -17,8 +17,10 @@ public static class ServiceRegistrationExtensions { var configSection = configuration.GetSection(WallabagSettings.Position); services.Configure(configSection); - services.AddScoped(); - services.AddScoped(); + // services.AddScoped(); + // services.AddScoped(); + services.AddSingleton(); + services.AddSingleton(); services.AddHttpClient() .SetHandlerLifetime(TimeSpan.FromMinutes(5)) //Set lifetime to five minutes .AddPolicyHandler(GetRetryPolicy()); diff --git a/src/Services/Wallabag.Client/Wallabag.Client.csproj b/src/Services/Wallabag.Client/Wallabag.Client.csproj index 8684a5d..7b7326e 100644 --- a/src/Services/Wallabag.Client/Wallabag.Client.csproj +++ b/src/Services/Wallabag.Client/Wallabag.Client.csproj @@ -1,17 +1,17 @@ - net6.0 + net8.0 enable enable - - - - - + + + + + diff --git a/src/Wallabag/Wallabag.csproj b/src/Wallabag/Wallabag.csproj index 28390cd..aa9ef25 100644 --- a/src/Wallabag/Wallabag.csproj +++ b/src/Wallabag/Wallabag.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable enable dotnet-WallabagWorker-D5E52F5F-C642-4BF8-9FD7-8C6C417B0D3A @@ -9,9 +9,9 @@ - - - + + +