Skip to content

Commit

Permalink
Upgrade to ABP 9.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gdlcf88 committed Dec 22, 2024
1 parent b4e3ce9 commit 60c466d
Show file tree
Hide file tree
Showing 58 changed files with 21,707 additions and 8,478 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: NuGet/setup-nuget@v1
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'

- name: read common.props
id: commonProps
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>

<AbpVersion>8.3.2</AbpVersion>
<CapPackageVersion>8.3.0</CapPackageVersion>
<AbpVersion>9.0.2</AbpVersion>
<CapPackageVersion>8.3.2</CapPackageVersion>
<CapInMemoryMessageQueuePackageVersion>8.2.1</CapInMemoryMessageQueuePackageVersion>

</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion common.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>8.3.0</Version>
<Version>9.0.2</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>EasyAbp Team</Authors>
Expand Down
12 changes: 6 additions & 6 deletions sample/App1/App1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DotNetCore.CAP.Dashboard" Version="$(CapPackageVersion)" />
<PackageReference Include="DotNetCore.CAP.PostgreSql" Version="$(CapPackageVersion)" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="$(CapPackageVersion)" />
<PackageReference Include="DotNetCore.CAP.InMemoryStorage" Version="$(CapPackageVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="9.0.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="$(AbpVersion)" />
<PackageReference Include="Volo.Abp.Autofac" Version="$(AbpVersion)" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="$(AbpVersion)" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="2.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="WorkflowCore" Version="3.4.0" />
<PackageReference Include="WorkflowCore.Persistence.Sqlite" Version="3.3.0" />
Expand Down
2 changes: 1 addition & 1 deletion sample/App1/App1Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public override void OnApplicationInitialization(ApplicationInitializationContex
{
app.UseExceptionHandler("/Error");
}
app.UseStaticFiles();
app.MapAbpStaticAssets();
app.UseSerilogRequestLogging();
app.UseRouting();
app.UseAbpSerilogEnrichers();
Expand Down
83 changes: 42 additions & 41 deletions sample/App1/Program.cs
Original file line number Diff line number Diff line change
@@ -1,55 +1,56 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Serilog;
using Volo.Abp;
using Serilog.Events;

namespace App1
namespace App1;

public class Program
{
internal class Program
public async static Task<int> Main(string[] args)
{
public static int Main(string[] args)
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
#else
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Async(c => c.Console())
.CreateLogger();

try
{
CreateLoggerUsingJSONFile();
try
{
Log.Information("Starting App1.WebHost.");
CreateHostBuilder(args, Log.Logger).Build().Run();
return 0;
}
catch (Exception ex)
{
return 1;
}
finally
Log.Information("Starting web host.");
var builder = WebApplication.CreateBuilder(args);
builder.Host.AddAppSettingsSecretsJson()
.UseAutofac()
.UseSerilog();
await builder.AddApplicationAsync<App1Module>();
var app = builder.Build();
await app.InitializeApplicationAsync();
await app.RunAsync();
return 0;
}
catch (Exception ex)
{
if (ex is HostAbortedException)
{
Log.CloseAndFlush();
throw;
}
}

internal static IHostBuilder CreateHostBuilder(string[] args, ILogger logger) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.UseAutofac()
.UseSerilog(logger);


private static void CreateLoggerUsingJSONFile()
Log.Fatal(ex, "Host terminated unexpectedly!");
return 1;
}
finally
{
var configuration = new ConfigurationBuilder()
.AddJsonFile("appsettings.json").Build();

Log.Logger = new LoggerConfiguration()
.ReadFrom
.Configuration(configuration).CreateLogger();
Log.CloseAndFlush();
}


}
}
}
}
18 changes: 0 additions & 18 deletions sample/App1/Startup.cs

This file was deleted.

8 changes: 4 additions & 4 deletions sample/App2/App2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DotNetCore.CAP.SqlServer" Version="$(CapPackageVersion)" />
<PackageReference Include="Volo.Abp.Autofac" Version="$(AbpVersion)" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="$(AbpVersion)" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="$(AbpVersion)" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="2.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="DotNetCore.CAP.Dashboard" Version="$(CapPackageVersion)" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="$(CapPackageVersion)" />
Expand Down
2 changes: 1 addition & 1 deletion sample/App2/App2Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public override void OnApplicationInitialization(ApplicationInitializationContex
{
app.UseExceptionHandler("/Error");
}
app.UseStaticFiles();
app.MapAbpStaticAssets();
app.UseSerilogRequestLogging();
app.UseRouting();
app.UseAbpSerilogEnrichers();
Expand Down
82 changes: 41 additions & 41 deletions sample/App2/Program.cs
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Serilog;
using Volo.Abp;
using Serilog.Events;

namespace App2
namespace App2;

public class Program
{
internal class Program
public async static Task<int> Main(string[] args)
{
public static int Main(string[] args)
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
#else
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Async(c => c.Console())
.CreateLogger();

try
{
CreateLoggerUsingJSONFile();
try
{
Log.Information("Starting App2.WebHost.");
CreateHostBuilder(args, Log.Logger)
.Build()
.Run();
return 0;
}
catch (Exception ex)
{
return 1;
}
finally
Log.Information("Starting web host.");
var builder = WebApplication.CreateBuilder(args);
builder.Host.AddAppSettingsSecretsJson()
.UseAutofac()
.UseSerilog();
await builder.AddApplicationAsync<App2Module>();
var app = builder.Build();
await app.InitializeApplicationAsync();
await app.RunAsync();
return 0;
}
catch (Exception ex)
{
if (ex is HostAbortedException)
{
Log.CloseAndFlush();
throw;
}
}

internal static IHostBuilder CreateHostBuilder(string[] args, ILogger logger) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.UseAutofac()
.UseSerilog(logger);


private static void CreateLoggerUsingJSONFile()
Log.Fatal(ex, "Host terminated unexpectedly!");
return 1;
}
finally
{
var configuration = new ConfigurationBuilder()
.AddJsonFile("appsettings.json").Build();

Log.Logger = new LoggerConfiguration()
.ReadFrom
.Configuration(configuration).CreateLogger();
Log.CloseAndFlush();
}

}
}
}
18 changes: 0 additions & 18 deletions sample/App2/Startup.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>CapSample</RootNamespace>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>CapSample</RootNamespace>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -22,9 +22,9 @@

<ItemGroup>
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="2.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\common.props" />

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>CapSample</RootNamespace>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
</PropertyGroup>
Expand All @@ -25,7 +25,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="8.0.4" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="9.0.0" />
</ItemGroup>

</Project>
Loading

0 comments on commit 60c466d

Please sign in to comment.