Skip to content

Commit c560c3f

Browse files
authored
Merge pull request #70 from cloudscribe/develop
master v10
2 parents 0fdaffe + b3047d5 commit c560c3f

16 files changed

Lines changed: 117 additions & 102 deletions

File tree

src/Demo.WebApp/Demo.WebApp.csproj

Lines changed: 11 additions & 11 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>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<UserSecretsId>Demo.WebApp-903DD7B4-EED4-4F85-A8BD-F9EE1049BFF3</UserSecretsId>
66
<PreserveCompilationContext>true</PreserveCompilationContext>
77
<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
@@ -24,16 +24,16 @@
2424
</ItemGroup>
2525

2626
<ItemGroup Label="Package References">
27-
<PackageReference Include="cloudscribe.Core.Web" Version="8.7.*" />
28-
<PackageReference Include="cloudscribe.Core.CompiledViews.Bootstrap5" Version="8.7.0" />
29-
<PackageReference Include="cloudscribe.Core.Storage.EFCore.MSSQL" Version="8.7.0" />
30-
<PackageReference Include="cloudscribe.Core.Storage.EFCore.MySql" Version="8.7.0" />
31-
<PackageReference Include="cloudscribe.Core.Storage.EFCore.PostgreSql" Version="8.7.0" />
32-
<PackageReference Include="cloudscribe.Core.Storage.EFCore.SQLite" Version="8.7.0" />
33-
<PackageReference Include="cloudscribe.Core.Storage.NoDb" Version="8.7.0" />
34-
35-
<PackageReference Include="cloudscribe.Web.Localization" Version="8.7.0" />
36-
<PackageReference Include="cloudscribe.Web.StaticFiles" Version="8.7.0" />
27+
<PackageReference Include="cloudscribe.Core.Web" Version="10.0.*" />
28+
<PackageReference Include="cloudscribe.Core.CompiledViews.Bootstrap5" Version="10.0.0" />
29+
<PackageReference Include="cloudscribe.Core.Storage.EFCore.MSSQL" Version="10.0.0" />
30+
<PackageReference Include="cloudscribe.Core.Storage.EFCore.MySql" Version="10.0.0" />
31+
<PackageReference Include="cloudscribe.Core.Storage.EFCore.PostgreSql" Version="10.0.0" />
32+
<PackageReference Include="cloudscribe.Core.Storage.EFCore.SQLite" Version="10.0.0" />
33+
<PackageReference Include="cloudscribe.Core.Storage.NoDb" Version="10.0.0" />
34+
35+
<PackageReference Include="cloudscribe.Web.Localization" Version="10.0.0" />
36+
<PackageReference Include="cloudscribe.Web.StaticFiles" Version="10.0.0" />
3737
</ItemGroup>
3838

3939
<ItemGroup>

src/Demo.WebApp/Program.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
using cloudscribe.Logging.Models;
2-
using Microsoft.AspNetCore;
32
using Microsoft.AspNetCore.Hosting;
43
using Microsoft.Extensions.Configuration;
54
using Microsoft.Extensions.DependencyInjection;
65
using Microsoft.Extensions.Hosting;
76
using Microsoft.Extensions.Logging;
87
using System;
9-
using System.Collections.Generic;
108
using System.Linq;
9+
using System.Threading.Tasks;
1110

1211
namespace Demo.WebApp
1312
{
1413
public class Program
1514
{
16-
public static void Main(string[] args)
15+
public static async Task Main(string[] args)
1716
{
1817
var host = CreateHostBuilder(args).Build();
1918

@@ -23,7 +22,7 @@ public static void Main(string[] args)
2322
var scopedServices = scope.ServiceProvider;
2423
try
2524
{
26-
EnsureDataStorageIsReady(scopedServices);
25+
await EnsureDataStorageIsReadyAsync(scopedServices);
2726

2827
}
2928
catch (Exception ex)
@@ -53,14 +52,14 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
5352
webBuilder.UseStartup<Startup>();
5453
});
5554

56-
private static void EnsureDataStorageIsReady(IServiceProvider scopedServices)
55+
// .NET 10 migration: Changed from synchronous to async to avoid blocking calls (.Wait() is deprecated)
56+
// See: https://learn.microsoft.com/en-us/dotnet/core/compatibility/aspnet-core/9.0/synchronous-main
57+
private static async Task EnsureDataStorageIsReadyAsync(IServiceProvider scopedServices)
5758
{
5859
var deletPostsOlderThanDays = 30;
59-
LoggingEFStartup.InitializeDatabaseAsync(scopedServices, deletPostsOlderThanDays).Wait();
60+
await LoggingEFStartup.InitializeDatabaseAsync(scopedServices, deletPostsOlderThanDays);
6061

61-
CoreEFStartup.InitializeDatabaseAsync(scopedServices).Wait();
62-
63-
62+
await CoreEFStartup.InitializeDatabaseAsync(scopedServices);
6463
}
6564

6665
private static void ConfigureLogging(

src/Demo.WebApp/Properties/launchSettings.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"windowsAuthentication": false,
44
"anonymousAuthentication": true,
55
"iisExpress": {
6-
"applicationUrl": "http://localhost:45714/",
7-
"sslPort": 44368
6+
"applicationUrl": "https://localhost:44368/",
7+
"sslPort": 44368
88
}
99
},
1010
"profiles": {
@@ -17,28 +17,28 @@
1717
}
1818
},
1919
"IIS Express Production": {
20-
"commandName": "IISExpress",
21-
"launchBrowser": true,
22-
"launchUrl": "http://localhost:45714/",
23-
"environmentVariables": {
24-
"ASPNETCORE_ENVIRONMENT": "Production"
25-
}
20+
"commandName": "IISExpress",
21+
"launchBrowser": true,
22+
"launchUrl": "https://localhost:44368/",
23+
"environmentVariables": {
24+
"ASPNETCORE_ENVIRONMENT": "Production"
25+
}
2626
},
2727
"Demo.WebApp": {
28-
"commandName": "Project",
29-
"launchBrowser": true,
30-
"environmentVariables": {
31-
"ASPNETCORE_ENVIRONMENT": "Development"
32-
},
33-
"applicationUrl": "http://localhost:45713/"
28+
"commandName": "Project",
29+
"launchBrowser": true,
30+
"environmentVariables": {
31+
"ASPNETCORE_ENVIRONMENT": "Development"
32+
},
33+
"applicationUrl": "https://localhost:44368/"
3434
},
3535
"Demo.WebApp Production": {
36-
"commandName": "Project",
37-
"launchBrowser": true,
38-
"environmentVariables": {
39-
"ASPNETCORE_ENVIRONMENT": "Production"
40-
},
41-
"applicationUrl": "http://localhost:45713/"
36+
"commandName": "Project",
37+
"launchBrowser": true,
38+
"environmentVariables": {
39+
"ASPNETCORE_ENVIRONMENT": "Production"
40+
},
41+
"applicationUrl": "https://localhost:44368/"
4242
}
4343
}
4444
}

src/WebAppMvc/Program.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class Program
1818
// CreateHostBuilder(args).Build().Run();
1919
//}
2020

21-
public static void Main(string[] args)
21+
public static async Task Main(string[] args)
2222
{
2323
var host = CreateHostBuilder(args).Build();
2424

@@ -28,7 +28,7 @@ public static void Main(string[] args)
2828
var scopedServices = scope.ServiceProvider;
2929
try
3030
{
31-
EnsureDataStorageIsReady(scopedServices);
31+
await EnsureDataStorageIsReadyAsync(scopedServices);
3232

3333
}
3434
catch (Exception ex)
@@ -55,14 +55,12 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
5555

5656

5757

58-
private static void EnsureDataStorageIsReady(IServiceProvider scopedServices)
58+
// .NET 10 migration: Changed from synchronous to async to avoid blocking calls (.Wait() is deprecated)
59+
// See: https://learn.microsoft.com/en-us/dotnet/core/compatibility/aspnet-core/9.0/synchronous-main
60+
private static async Task EnsureDataStorageIsReadyAsync(IServiceProvider scopedServices)
5961
{
6062
var deletPostsOlderThanDays = 30;
61-
LoggingEFStartup.InitializeDatabaseAsync(scopedServices, deletPostsOlderThanDays).Wait();
62-
63-
64-
65-
63+
await LoggingEFStartup.InitializeDatabaseAsync(scopedServices, deletPostsOlderThanDays);
6664
}
6765

6866

src/WebAppMvc/Startup.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ public void ConfigureServices(IServiceCollection services)
105105
services.AddScoped<cloudscribe.DateTimeUtils.ITimeZoneHelper, cloudscribe.DateTimeUtils.TimeZoneHelper>();
106106

107107
services.AddHttpContextAccessor();
108-
services.AddSingleton<IActionContextAccessor, ActionContextAccessor>();
108+
// .NET 10: IActionContextAccessor is deprecated. Remove this registration.
109+
// If needed, inject IHttpContextAccessor instead and access HttpContext directly.
110+
// See: https://aka.ms/aspnet/deprecate/006
111+
//services.AddSingleton<IActionContextAccessor, ActionContextAccessor>();
109112

110113

111114
services.AddCloudscribeLogging();

src/WebAppMvc/WebAppMvc.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.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<IsPackable>false</IsPackable>
66
</PropertyGroup>
77

src/cloudscribe.Logging.EFCore.Common/LoggingDbContextBase.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ public LoggingDbContextBase(DbContextOptions options) : base(options)
2020
}
2121

2222
public DbSet<LogItem> LogItems { get; set; }
23-
23+
24+
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
25+
{
26+
// Suppress pending model changes warning in .NET 10
27+
// EF Core 10 detects minor model differences that don't require actual schema changes
28+
optionsBuilder.ConfigureWarnings(warnings =>
29+
warnings.Ignore(Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.PendingModelChangesWarning));
30+
31+
base.OnConfiguring(optionsBuilder);
32+
}
2433
}
2534
}

src/cloudscribe.Logging.EFCore.Common/cloudscribe.Logging.EFCore.Common.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<PropertyGroup>
44
<Description>Entity Framework Core implementation of cloudscribe ILogRepository</Description>
5-
<Version>8.7.0</Version>
6-
<TargetFramework>net8.0</TargetFramework>
5+
<Version>10.0.0</Version>
6+
<TargetFramework>net10.0</TargetFramework>
77
<Authors>Joe Audette</Authors>
88
<PackageTags>cloudscribe;repositories;logging</PackageTags>
99
<PackageIcon>icon.png</PackageIcon>
@@ -21,8 +21,8 @@
2121
</ItemGroup>
2222

2323
<ItemGroup>
24-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
25-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.0" />
24+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.0" />
25+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.0" />
2626
</ItemGroup>
2727

2828
<ItemGroup>

src/cloudscribe.Logging.EFCore.MSSQL/cloudscribe.Logging.EFCore.MSSQL.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<PropertyGroup>
44
<Description>MSSQL Entity Framework Core implementation of cloudscribe ILogRepository</Description>
5-
<Version>8.7.0</Version>
6-
<TargetFramework>net8.0</TargetFramework>
5+
<Version>10.0.0</Version>
6+
<TargetFramework>net10.0</TargetFramework>
77
<Authors>Joe Audette</Authors>
88
<PackageTags>cloudscribe;repositories;logging</PackageTags>
99
<PackageIcon>icon.png</PackageIcon>
@@ -25,11 +25,11 @@
2525
</ItemGroup>
2626

2727
<ItemGroup>
28-
<PackageReference Include="cloudscribe.Versioning" Version="8.7.0" />
29-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
30-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0" />
31-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.0" />
32-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
28+
<PackageReference Include="cloudscribe.Versioning" Version="10.0.0" />
29+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.0" />
30+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0" />
31+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.0" />
32+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.0" />
3333
</ItemGroup>
3434

3535
</Project>

src/cloudscribe.Logging.EFCore.MySql/cloudscribe.Logging.EFCore.MySql.csproj

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<PropertyGroup>
44
<Description>MySQL Entity Framework Core implementation of cloudscribe ILogRepository</Description>
5-
<Version>8.7.0</Version>
6-
<TargetFramework>net8.0</TargetFramework>
5+
<Version>10.0.0</Version>
6+
<TargetFramework>net10.0</TargetFramework>
77
<Authors>Joe Audette</Authors>
88
<PackageTags>cloudscribe;repositories;logging</PackageTags>
99
<PackageIcon>icon.png</PackageIcon>
@@ -26,10 +26,11 @@
2626
</ItemGroup>
2727

2828
<ItemGroup>
29-
<PackageReference Include="cloudscribe.Versioning" Version="8.7.0" />
30-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
31-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0" />
32-
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.0" />
29+
<PackageReference Include="cloudscribe.Versioning" Version="10.0.0" />
30+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.0" />
31+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.0" />
32+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.0" />
33+
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0" />
3334
</ItemGroup>
3435

3536

0 commit comments

Comments
 (0)