Skip to content

Commit 2d151fa

Browse files
committed
TD-4168: Upgrade LH solutions to .NET 8 (LTS)
1 parent 24340cc commit 2d151fa

File tree

39 files changed

+174
-114
lines changed

39 files changed

+174
-114
lines changed

AdminUI/LearningHub.Nhs.AdminUI/LearningHub.Nhs.AdminUI.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<UserSecretsId>31abd8b9-4223-4ff3-896b-a46530c9e15c</UserSecretsId>
66
<ApplicationInsightsResourceId>/subscriptions/57c55d5f-78c1-4373-a021-ff8357548f51/resourceGroups/LearningHubNhsUk-AdminUI-Prod-RG/providers/microsoft.insights/components/LearningHubNhsUk-AdminUI-Prod</ApplicationInsightsResourceId>
77
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
@@ -80,12 +80,12 @@
8080

8181
<ItemGroup>
8282
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.1" />
83-
<PackageReference Include="Azure.Storage.Blobs" Version="12.10.0" />
83+
<PackageReference Include="Azure.Storage.Blobs" Version="12.23.0" />
8484
<PackageReference Include="Azure.Storage.Files.Shares" Version="12.8.0" />
8585
<PackageReference Include="BuildWebCompiler" Version="1.12.405" />
8686
<PackageReference Include="elfhHub.Nhs.Models" Version="3.0.8" />
87-
<PackageReference Include="FluentValidation" Version="10.3.4" />
88-
<PackageReference Include="FluentValidation.AspNetCore" Version="10.3.4" />
87+
<PackageReference Include="FluentValidation" Version="11.11.0" />
88+
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" />
8989
<PackageReference Include="HtmlSanitizer" Version="6.0.453" />
9090
<PackageReference Include="IdentityModel" Version="4.4.0" />
9191
<PackageReference Include="LearningHub.Nhs.Caching" Version="2.0.2" />
@@ -97,8 +97,8 @@
9797
<PackageReference Include="Microsoft.FeatureManagement" Version="3.2.0" />
9898
<PackageReference Include="Microsoft.FeatureManagement.AspNetCore" Version="3.2.0" />
9999
<PackageReference Include="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="5.2.9" />
100-
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="6.14.1" />
101-
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.14.1" />
100+
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.2.1" />
101+
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.2.1" />
102102
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication" Version="2.4.1" />
103103
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="4.5.2">
104104
<PrivateAssets>all</PrivateAssets>
@@ -108,8 +108,8 @@
108108
<PackageReference Include="MK.IO" Version="1.6.0" />
109109
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
110110
<PackageReference Include="NLog.Web.AspNetCore" Version="4.14.0" />
111-
<PackageReference Include="System.Data.SqlClient" Version="4.8.3" />
112-
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.14.1" />
111+
<PackageReference Include="System.Data.SqlClient" Version="4.9.0" />
112+
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.2.1" />
113113
</ItemGroup>
114114

115115

AdminUI/LearningHub.Nhs.AdminUI/ServiceCollectionExtension.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,15 @@ public static void ConfigureServices(this IServiceCollection services, IConfigur
195195
// Auto Mapper Configurations
196196
var mappingConfig = new MapperConfiguration(mc =>
197197
{
198+
mc.AllowNullCollections = true;
199+
mc.ShouldMapMethod = m => false;
198200
mc.AddProfile(new MappingProfile());
199201
});
202+
203+
////var mappingConfig = new MapperConfiguration(mc =>
204+
////{
205+
//// mc.AddProfile(new MappingProfile());
206+
////});
200207
IMapper mapper = mappingConfig.CreateMapper();
201208
services.AddSingleton(mapper);
202209

LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
66
<UserSecretsId>a2ecb5d2-cf13-4551-9cb6-3d86dfbcf8ef</UserSecretsId>
77
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
@@ -101,9 +101,9 @@
101101

102102

103103
<ItemGroup>
104-
<PackageReference Include="Azure.Storage.Blobs" Version="12.10.0" />
104+
<PackageReference Include="Azure.Storage.Blobs" Version="12.23.0" />
105105
<PackageReference Include="elfhHub.Nhs.Models" Version="3.0.8" />
106-
<PackageReference Include="FluentValidation.AspNetCore" Version="10.3.4" />
106+
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" />
107107
<PackageReference Include="GDS.MultiPageFormData" Version="1.0.5" />
108108
<PackageReference Include="HtmlAgilityPack" Version="1.11.38" />
109109
<PackageReference Include="IdentityModel" Version="4.3.0" />
@@ -130,7 +130,7 @@
130130
<PrivateAssets>all</PrivateAssets>
131131
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
132132
</PackageReference>
133-
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="7.0.0" />
133+
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="9.0.0" />
134134
<PackageReference Include="tusdotnet" Version="2.5.0" />
135135
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="4.5.2">
136136
<PrivateAssets>all</PrivateAssets>

LearningHub.Nhs.WebUI/ServiceCollectionExtension.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ public static void ConfigureServices(this IServiceCollection services, IConfigur
129129
opt.DefaultExpiryInMinutes = 60;
130130
});
131131

132+
services.AddControllersWithViews().AddNewtonsoftJson();
132133
services.AddControllersWithViews().AddRazorRuntimeCompilation();
133134

134135
services.AddFeatureManagement();

OpenAPI/LearningHub.Nhs.OpenApi.Models/LearningHub.Nhs.OpenApi.Models.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<GenerateDocumentationFile>true</GenerateDocumentationFile>
66
<Nullable>enable</Nullable>
77
<Platforms>x64</Platforms>
@@ -16,7 +16,7 @@
1616
</PropertyGroup>
1717

1818
<ItemGroup>
19-
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.41" />
19+
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.42" />
2020
<PackageReference Include="NLog.Web.AspNetCore" Version="4.13.0" />
2121
</ItemGroup>
2222

OpenAPI/LearningHub.Nhs.OpenApi.Repositories.Interface/LearningHub.Nhs.OpenApi.Repositories.Interface.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<RootNamespace>LearningHub.Nhs.OpenApi.Repositories.Interface</RootNamespace>
66
<Nullable>enable</Nullable>
77
<GenerateDocumentationFile>true</GenerateDocumentationFile>

OpenAPI/LearningHub.Nhs.OpenApi.Repositories/EntityFramework/ServiceMappings.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ public static class ServiceMappings
2424
/// <param name="services">The IServiceCollection.</param>
2525
public static void ConfigureAutomapper(this IServiceCollection services)
2626
{
27-
var mappingConfig = new MapperConfiguration(mc => { mc.AddProfile(new MappingProfile()); });
27+
var mappingConfig = new MapperConfiguration(mc =>
28+
{
29+
mc.AllowNullCollections = true;
30+
mc.ShouldMapMethod = m => false;
31+
mc.AddProfile(new MappingProfile());
32+
});
33+
////var mappingConfig = new MapperConfiguration(mc => { mc.AddProfile(new MappingProfile()); });
2834
IMapper mapper = mappingConfig.CreateMapper();
2935
services.AddSingleton(mapper);
3036
}

OpenAPI/LearningHub.Nhs.OpenApi.Repositories/LearningHub.Nhs.OpenApi.Repositories.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<RootNamespace>LearningHub.Nhs.OpenApi.Repositories</RootNamespace>
66
<Nullable>enable</Nullable>
77
<GenerateDocumentationFile>true</GenerateDocumentationFile>

OpenAPI/LearningHub.Nhs.OpenApi.Services.Interface/LearningHub.Nhs.OpenApi.Services.Interface.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
77
<Platforms>x64</Platforms>
@@ -16,7 +16,7 @@
1616
</PropertyGroup>
1717

1818
<ItemGroup>
19-
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.41" />
19+
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.42" />
2020
</ItemGroup>
2121

2222
<ItemGroup>

OpenAPI/LearningHub.Nhs.OpenApi.Services/LearningHub.Nhs.OpenApi.Services.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<RootNamespace>LearningHub.Nhs.OpenApi.Services</RootNamespace>
66
<Nullable>enable</Nullable>
77
<GenerateDocumentationFile>true</GenerateDocumentationFile>
@@ -22,12 +22,12 @@
2222
</ItemGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="FluentValidation.AspNetCore" Version="10.3.4" />
25+
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" />
2626
<PackageReference Include="IdentityModel" Version="4.3.0" />
27-
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.41" />
27+
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.42" />
2828
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" />
2929
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0" />
30-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
30+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
3131
<PackageReference Include="NLog.Web.AspNetCore" Version="4.13.0" />
3232
</ItemGroup>
3333

0 commit comments

Comments
 (0)