Skip to content

Commit

Permalink
Dotnet9 (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofPajak authored Dec 1, 2024
1 parent d3a89c5 commit a754a4a
Show file tree
Hide file tree
Showing 62 changed files with 185 additions and 202 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/aspnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Restore
run: dotnet restore ./GrandNode.sln
- name: Build with dotnet
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/grandnode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Create mongoDB Docker container
run: sudo docker run -d -p 27017:27017 mongo:latest
- name: Restore
Expand Down
131 changes: 66 additions & 65 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,67 +1,68 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="MaxMind.GeoIP2" Version="5.2.0"/>
<PackageVersion Include="ExcelMapper" Version="5.2.483"/>
<PackageVersion Include="Scryber.Core" Version="6.0.4-beta"/>
<PackageVersion Include="Scryber.Core.OpenType" Version="6.1.0-beta"/>
<PackageVersion Include="MailKit" Version="4.8.0"/>
<PackageVersion Include="AWSSDK.Core" Version="3.7.400.40"/>
<PackageVersion Include="AWSSDK.S3" Version="3.7.405.4"/>
<PackageVersion Include="Azure.Storage.Blobs" Version="12.22.2"/>
<PackageVersion Include="SkiaSharp" Version="2.88.8"/>
<PackageVersion Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.8"/>
<PackageVersion Include="LiteDB" Version="5.0.17"/>
<PackageVersion Include="MongoDB.Bson" Version="3.0.0"/>
<PackageVersion Include="MongoDB.Driver" Version="3.0.0"/>
<PackageVersion Include="DotLiquid" Version="2.2.692"/>
<PackageVersion Include="FluentValidation.DependencyInjectionExtensions" Version="11.10.0"/>
<PackageVersion Include="GoogleAuthenticator" Version="3.2.0"/>
<PackageVersion Include="MassTransit" Version="8.3.0"/>
<PackageVersion Include="MassTransit.RabbitMQ" Version="8.3.0"/>
<PackageVersion Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0"/>
<PackageVersion Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="8.0.0"/>
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.10"/>
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1"/>
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1"/>
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="8.0.2"/>
<PackageVersion Include="AutoMapper" Version="13.0.1"/>
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0"/>
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.11.0"/>
<PackageVersion Include="MediatR" Version="12.4.1"/>
<PackageVersion Include="Scrutor" Version="5.0.1"/>
<PackageVersion Include="StackExchange.Redis" Version="2.8.16"/>
<PackageVersion Include="FluentValidation" Version="11.10.0"/>
<PackageVersion Include="Microsoft.AspNetCore.JsonPatch" Version="8.0.10"/>
<PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.10"/>
<PackageVersion Include="Microsoft.AspNetCore.OData" Version="9.0.0"/>
<PackageVersion Include="MongoDB.AspNetCore.OData" Version="1.0.1"/>
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.9.0"/>
<PackageVersion Include="Swashbuckle.AspNetCore.Annotations" Version="6.9.0"/>
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Facebook" Version="8.0.10"/>
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.10"/>
<PackageVersion Include="Braintree" Version="5.27.0"/>
<PackageVersion Include="System.Xml.XPath.XmlDocument" Version="4.3.0"/>
<PackageVersion Include="Stripe.net" Version="46.2.1"/>
<PackageVersion Include="elFinder.Net.AspNetCore" Version="1.5.0"/>
<PackageVersion Include="elFinder.Net.Core" Version="1.5.0"/>
<PackageVersion Include="elFinder.Net.Drivers.FileSystem" Version="1.5.0"/>
<PackageVersion Include="Azure.Extensions.AspNetCore.DataProtection.Blobs" Version="1.3.4"/>
<PackageVersion Include="Azure.Extensions.AspNetCore.DataProtection.Keys" Version="1.2.4"/>
<PackageVersion Include="Azure.Identity" Version="1.13.1"/>
<PackageVersion Include="Flurl.Http" Version="4.0.2"/>
<PackageVersion Include="Microsoft.ApplicationInsights.Profiler.AspNetCore" Version="2.7.2"/>
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.10"/>
<PackageVersion Include="NetEscapades.AspNetCore.SecurityHeaders" Version="0.24.0"/>
<PackageVersion Include="Wangkanai.Detection" Version="8.14.0"/>
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.10"/>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1"/>
<PackageVersion Include="Moq" Version="4.20.72"/>
<PackageVersion Include="MSTest.TestAdapter" Version="3.6.1"/>
<PackageVersion Include="MSTest.TestFramework" Version="3.6.1"/>
<PackageVersion Include="coverlet.collector" Version="6.0.2"/>
<PackageVersion Include="NUnit" Version="4.2.2"/>
</ItemGroup>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="MaxMind.GeoIP2" Version="5.2.0" />
<PackageVersion Include="ExcelMapper" Version="5.2.593" />
<PackageVersion Include="NPOI" Version="2.7.2" />
<PackageVersion Include="Scryber.Core" Version="6.0.4-beta" />
<PackageVersion Include="Scryber.Core.OpenType" Version="6.1.0-beta" />
<PackageVersion Include="MailKit" Version="4.8.0" />
<PackageVersion Include="AWSSDK.Core" Version="3.7.400.57" />
<PackageVersion Include="AWSSDK.S3" Version="3.7.407.1" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.23.0" />
<PackageVersion Include="SkiaSharp" Version="2.88.9" />
<PackageVersion Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.9" />
<PackageVersion Include="LiteDB" Version="5.0.17" />
<PackageVersion Include="MongoDB.Bson" Version="3.0.0" />
<PackageVersion Include="MongoDB.Driver" Version="3.0.0" />
<PackageVersion Include="DotLiquid" Version="2.2.717" />
<PackageVersion Include="FluentValidation.DependencyInjectionExtensions" Version="11.11.0" />
<PackageVersion Include="GoogleAuthenticator" Version="3.2.0" />
<PackageVersion Include="MassTransit" Version="8.3.2" />
<PackageVersion Include="MassTransit.RabbitMQ" Version="8.3.2" />
<PackageVersion Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
<PackageVersion Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="9.0.0" />
<PackageVersion Include="AutoMapper" Version="13.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.11.0" />
<PackageVersion Include="MediatR" Version="12.4.1" />
<PackageVersion Include="Scrutor" Version="5.0.2" />
<PackageVersion Include="StackExchange.Redis" Version="2.8.16" />
<PackageVersion Include="FluentValidation" Version="11.11.0" />
<PackageVersion Include="Microsoft.AspNetCore.JsonPatch" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.OData" Version="9.1.1" />
<PackageVersion Include="MongoDB.AspNetCore.OData" Version="1.0.1" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="7.0.0" />
<PackageVersion Include="Swashbuckle.AspNetCore.Annotations" Version="7.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Facebook" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="9.0.0" />
<PackageVersion Include="Braintree" Version="5.28.0" />
<PackageVersion Include="System.Xml.XPath.XmlDocument" Version="4.7.0" />
<PackageVersion Include="Stripe.net" Version="47.1.0" />
<PackageVersion Include="elFinder.Net.AspNetCore" Version="1.5.0" />
<PackageVersion Include="elFinder.Net.Core" Version="1.5.0" />
<PackageVersion Include="elFinder.Net.Drivers.FileSystem" Version="1.5.0" />
<PackageVersion Include="Azure.Extensions.AspNetCore.DataProtection.Blobs" Version="1.3.4" />
<PackageVersion Include="Azure.Extensions.AspNetCore.DataProtection.Keys" Version="1.2.4" />
<PackageVersion Include="Azure.Identity" Version="1.13.1" />
<PackageVersion Include="Flurl.Http" Version="4.0.2" />
<PackageVersion Include="Microsoft.ApplicationInsights.Profiler.AspNetCore" Version="2.7.2" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="9.0.0" />
<PackageVersion Include="NetEscapades.AspNetCore.SecurityHeaders" Version="0.24.0" />
<PackageVersion Include="Wangkanai.Detection" Version="8.14.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="9.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="MSTest.TestAdapter" Version="3.6.3" />
<PackageVersion Include="MSTest.TestFramework" Version="3.6.3" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="NUnit" Version="4.2.2" />
</ItemGroup>
</Project>
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env
LABEL stage=build-env
WORKDIR /app

Expand All @@ -24,7 +24,8 @@ RUN for plugin in /app/Plugins/*; do \
RUN dotnet publish /app/Web/Grand.Web/Grand.Web.csproj -c Release -o ./build/release -p:SourceRevisionId=$GIT_COMMIT -p:GitBranch=$GIT_BRANCH

# Runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime

EXPOSE 8080
WORKDIR /app
COPY --from=build-env /app/build/release .
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ steps:
- task: UseDotNet@2
displayName: 'Install .NET Core SDK 8'
inputs:
version: '8.0.x'
version: '9.0.x'

- task: NuGetToolInstaller@1
displayName: 'Install NuGet >=6.3.0-0'
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"version": "8.0.101",
"version": "9.0.100",
"rollForward": "latestFeature",
"allowPrerelease": false
}
}
}
2 changes: 1 addition & 1 deletion src/Build/Grand.Common.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<Product>grandnode</Product>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
services.AddScoped<IRefreshTokenService, RefreshTokenService>();
}

public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
{
public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
{
}

public int Priority => 100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
RegisterExportImport(services);
}

public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
RegisterExportImport(services);
}

public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
services.AddScoped<IRobotsTxtService, RobotsTxtService>();
}

public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<Import Project="..\..\Build\Grand.Common.props" />
<ItemGroup>
<PackageReference Include="ExcelMapper" />
<PackageReference Include="NPOI" />
<PackageReference Include="Scryber.Core" />
<PackageReference Include="Scryber.Core.OpenType" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
RegisterExportImportService(services);
}

public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
RegisterCustomerService(services);
}

public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
RegisterCustomer(services);
}

public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
});
}

public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
});
}

public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Core/Grand.Infrastructure/IStartupApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ public interface IStartupApplication
/// </summary>
/// <param name="application">Builder for configuring an application's request pipeline</param>
/// <param name="webHostEnvironment">WebHostEnvironment</param>
void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment);
void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class StartupApplication : IStartupApplication
public bool BeforeConfigure => false;


public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Core/Grand.Infrastructure/StartupBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public static void ConfigureServices(IServiceCollection services, IConfiguration
/// </summary>
/// <param name="application">Builder for configuring an application's request pipeline</param>
/// <param name="webHostEnvironment">WebHostEnvironment</param>
public static void ConfigureRequestPipeline(IApplicationBuilder application,
public static void ConfigureRequestPipeline(WebApplication application,
IWebHostEnvironment webHostEnvironment)
{
//find startup configurations provided by other assemblies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
/// </summary>
/// <param name="application">Builder for configuring an application's request pipeline</param>
/// <param name="webHostEnvironment">WebHostEnvironment</param>
public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/Modules/Grand.Module.Api/Infrastructure/ODataStartup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ namespace Grand.Module.Api.Infrastructure;

public class ODataStartup : IStartupApplication
{
public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
{
var apiConfig = application.ApplicationServices.GetService<BackendAPIConfig>();
var apiConfig = application.Services.GetService<BackendAPIConfig>();
if (apiConfig.Enabled) application.UseCors(Configurations.CorsPolicyName);
}

Expand Down
8 changes: 4 additions & 4 deletions src/Modules/Grand.Module.Api/Infrastructure/SwaggerStartup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ namespace Grand.Module.Api.Infrastructure;

public class SwaggerStartup : IStartupApplication
{
public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
{
var backendApiConfig = application.ApplicationServices.GetService<BackendAPIConfig>();
var frontApiConfig = application.ApplicationServices.GetService<FrontendAPIConfig>();
var swagger = application.ApplicationServices.GetService<IConfiguration>().GetValue<bool>("UseSwagger");
var backendApiConfig = application.Services.GetService<BackendAPIConfig>();
var frontApiConfig = application.Services.GetService<FrontendAPIConfig>();
var swagger = application.Services.GetService<IConfiguration>().GetValue<bool>("UseSwagger");
if (backendApiConfig.Enabled)
application.UseODataQueryRequest();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
RegisterInstallService(services);
}

public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
services.AddScoped<IMigrationProcess, MigrationProcess>();
}

public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
{
if (!DataSettingsManager.DatabaseIsInstalled())
return;

var serviceProvider = application.ApplicationServices;
var featureFlagsConfig = serviceProvider.GetRequiredService<FeatureFlagsConfig>();
var featureFlagsConfig = application.Services.GetRequiredService<FeatureFlagsConfig>();
if (featureFlagsConfig.Modules.TryGetValue("Grand.Module.Migration", out var value) && value)
{
var migrationProcess = serviceProvider.GetRequiredService<IMigrationProcess>();
var migrationProcess = application.Services.GetRequiredService<IMigrationProcess>();
migrationProcess.RunMigrationProcess();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
RegisterTask(services);
}

public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
public void Configure(WebApplication application, IWebHostEnvironment webHostEnvironment)
{
}

Expand Down
Loading

0 comments on commit a754a4a

Please sign in to comment.