global: switch to dotnet9

This commit is contained in:
Abdullah Atta
2025-12-15 22:58:25 +05:00
parent 8dd9d0dc62
commit 347507f00a
9 changed files with 25 additions and 11 deletions

6
.vscode/launch.json vendored
View File

@@ -9,7 +9,7 @@
"type": "coreclr", "type": "coreclr",
"request": "launch", "request": "launch",
"preLaunchTask": "build-notesnook", "preLaunchTask": "build-notesnook",
"program": "bin/Debug/net8.0/Notesnook.API.dll", "program": "bin/Debug/net9.0/Notesnook.API.dll",
"args": [], "args": [],
"cwd": "${workspaceFolder}/Notesnook.API", "cwd": "${workspaceFolder}/Notesnook.API",
"stopAtEntry": false, "stopAtEntry": false,
@@ -24,7 +24,7 @@
"type": "coreclr", "type": "coreclr",
"request": "launch", "request": "launch",
"preLaunchTask": "build-identity", "preLaunchTask": "build-identity",
"program": "bin/Debug/net8.0/Streetwriters.Identity.dll", "program": "bin/Debug/net9.0/Streetwriters.Identity.dll",
"args": [], "args": [],
"cwd": "${workspaceFolder}/Streetwriters.Identity", "cwd": "${workspaceFolder}/Streetwriters.Identity",
"stopAtEntry": false, "stopAtEntry": false,
@@ -39,7 +39,7 @@
"type": "coreclr", "type": "coreclr",
"request": "launch", "request": "launch",
"preLaunchTask": "build-messenger", "preLaunchTask": "build-messenger",
"program": "bin/Debug/net8.0/Streetwriters.Messenger.dll", "program": "bin/Debug/net9.0/Streetwriters.Messenger.dll",
"args": [], "args": [],
"cwd": "${workspaceFolder}/Streetwriters.Messenger", "cwd": "${workspaceFolder}/Streetwriters.Messenger",
"stopAtEntry": false, "stopAtEntry": false,

View File

@@ -29,6 +29,7 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Logging;
using MongoDB.Driver; using MongoDB.Driver;
using Notesnook.API.Authorization; using Notesnook.API.Authorization;
using Notesnook.API.Interfaces; using Notesnook.API.Interfaces;
@@ -67,9 +68,11 @@ namespace Notesnook.API.Hubs
]; ];
private readonly FrozenDictionary<string, Action<IEnumerable<SyncItem>, string, long>> UpsertActionsMap; private readonly FrozenDictionary<string, Action<IEnumerable<SyncItem>, string, long>> UpsertActionsMap;
private readonly Func<string, string[], bool, int, Task<IAsyncCursor<SyncItem>>>[] Collections; private readonly Func<string, string[], bool, int, Task<IAsyncCursor<SyncItem>>>[] Collections;
ILogger<SyncV2Hub> Logger { get; }
public SyncV2Hub(ISyncItemsRepositoryAccessor syncItemsRepositoryAccessor, IUnitOfWork unitOfWork) public SyncV2Hub(ISyncItemsRepositoryAccessor syncItemsRepositoryAccessor, IUnitOfWork unitOfWork, ILogger<SyncV2Hub> logger)
{ {
Logger = logger;
Repositories = syncItemsRepositoryAccessor; Repositories = syncItemsRepositoryAccessor;
unit = unitOfWork; unit = unitOfWork;

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<StartupObject>Notesnook.API.Program</StartupObject> <StartupObject>Notesnook.API.Program</StartupObject>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>

View File

@@ -42,6 +42,12 @@ namespace Notesnook.API
public static IHostBuilder CreateHostBuilder(string[] args) => public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args) Host.CreateDefaultBuilder(args)
.ConfigureLogging(logging =>
{
logging.ClearProviders();
logging.AddConsole();
logging.AddSystemdConsole();
})
.ConfigureWebHostDefaults(webBuilder => .ConfigureWebHostDefaults(webBuilder =>
{ {
webBuilder webBuilder

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>

View File

@@ -107,6 +107,11 @@ namespace Streetwriters.Identity
options.UsersCollection = "users"; options.UsersCollection = "users";
// options.MigrationCollection = "migration"; // options.MigrationCollection = "migration";
options.ConnectionString = connectionString; options.ConnectionString = connectionString;
options.ClusterConfigurator = builder =>
{
builder.ConfigureConnectionPool((c) => c.With(maxConnections: 500, minConnections: 0));
builder.ConfigureServer(s => s.With(heartbeatInterval: TimeSpan.FromSeconds(60)));
};
}).AddDefaultTokenProviders(); }).AddDefaultTokenProviders();
services.AddIdentityServer( services.AddIdentityServer(

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<StartupObject>Streetwriters.Identity.Program</StartupObject> <StartupObject>Streetwriters.Identity.Program</StartupObject>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
@@ -17,7 +17,7 @@
<PackageReference Include="SendGrid" Version="9.24.4" /> <PackageReference Include="SendGrid" Version="9.24.4" />
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" /> <PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
<PackageReference Include="Geralt" Version="3.1.0" /> <PackageReference Include="Geralt" Version="3.1.0" />
<PackageReference Include="IdentityServer4.Contrib.MongoDB" Version="4.0.0-rc.2" /> <PackageReference Include="Streetwriters.IdentityServer4.Contrib.MongoDB" Version="5.0.0" />
<PackageReference Include="IdentityServer4.AspNetIdentity" Version="4.1.2" /> <PackageReference Include="IdentityServer4.AspNetIdentity" Version="4.1.2" />
<PackageReference Include="IdentityServer4.EntityFramework" Version="4.1.2" /> <PackageReference Include="IdentityServer4.EntityFramework" Version="4.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.0" />
@@ -25,7 +25,7 @@
<PackageReference Include="Streetwriters.IdentityServer4.KeyRack.DataProtection" Version="0.1.0" /> <PackageReference Include="Streetwriters.IdentityServer4.KeyRack.DataProtection" Version="0.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection" Version="7.0.4" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection" Version="7.0.4" />
<PackageReference Include="AspNetCore.Identity.Mongo" Version="8.3.3" /> <PackageReference Include="AspNetCore.Identity.Mongo" Version="10.1.0" />
<PackageReference Include="Twilio" Version="6.13.0" /> <PackageReference Include="Twilio" Version="6.13.0" />
</ItemGroup> </ItemGroup>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<StartupObject>Streetwriters.Messenger.Program</StartupObject> <StartupObject>Streetwriters.Messenger.Program</StartupObject>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>