Skip to content

Commit

Permalink
🎉 update to .NET 8
Browse files Browse the repository at this point in the history
  • Loading branch information
WeihanLi committed Nov 19, 2023
1 parent e964038 commit 6c649e6
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 57 deletions.
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/OpenReservation/ReservationServer</RepositoryUrl>
<Authors>WeihanLi</Authors>
<Copyright>Copyright 2015-2022 (c) WeihanLi</Copyright>
<TargetFramework>net7.0</TargetFramework>
<DotNetPackageVersion>7.0.0</DotNetPackageVersion>
<Copyright>Copyright 2015-2023 (c) WeihanLi</Copyright>
<TargetFramework>net8.0</TargetFramework>
<DotNetPackageVersion>8.0.0</DotNetPackageVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Threading.Tasks;
using WeihanLi.Common;
using WeihanLi.Common.Models;
using WeihanLi.Common.Services;
using Xunit;

namespace OpenReservation.API.Test.Controllers;
Expand Down
14 changes: 5 additions & 9 deletions OpenReservation.API.Test/OpenReservation.API.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="Xunit.DependencyInjection" Version="8.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="Xunit.DependencyInjection" Version="8.9.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenReservation.API\OpenReservation.API.csproj" />
Expand Down
3 changes: 1 addition & 2 deletions OpenReservation.Common/OpenReservation.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http" Version="$(DotNetPackageVersion)" />
<PackageReference Include="Microsoft.Extensions.Options" Version="$(DotNetPackageVersion)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="$(DotNetPackageVersion)" />
<PackageReference Include="WeihanLi.Common" Version="1.0.56" />
<PackageReference Include="WeihanLi.Common" Version="1.0.60" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions OpenReservation.Database/OpenReservation.Database.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<Compile Remove="ServiceGenerator.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="WeihanLi.EntityFramework" Version="3.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0" />
<PackageReference Include="WeihanLi.EntityFramework" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenReservation.Models\OpenReservation.Models.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion OpenReservation.Helper/OpenReservation.Helper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="WeihanLi.Npoi" Version="2.4.2" />
<PackageReference Include="WeihanLi.Redis" Version="1.9.0" />
<PackageReference Include="WeihanLi.Web.Extensions" Version="1.5.0" />
<PackageReference Include="WeihanLi.Web.Extensions" Version="1.7.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenReservation.Business\OpenReservation.Business.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing.XUnit" Version="1.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.2" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 3 additions & 7 deletions OpenReservation.UnitTest/OpenReservation.UnitTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
22 changes: 10 additions & 12 deletions OpenReservation/OpenReservation.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<ItemGroup>
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="7.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="7.0.0" />
<PackageReference Include="prometheus-net.AspNetCore" Version="7.0.0" />
<PackageReference Include="prometheus-net.Contrib" Version="0.9.5" />
<PackageReference Include="prometheus-net.DotNetRuntime" Version="4.4.0" />
<PackageReference Include="Sentry.Extensions.Logging" Version="3.23.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.0" />
<PackageReference Include="prometheus-net.AspNetCore" Version="8.1.0" />
<PackageReference Include="Sentry.Extensions.Logging" Version="3.41.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="WeihanLi.Extensions.Localization.Json" Version="1.0.3" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0-*" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.0-*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenReservation.AdminLogic\OpenReservation.AdminLogic.csproj" />
Expand Down
11 changes: 0 additions & 11 deletions OpenReservation/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using OpenReservation;
using Prometheus.DotNetRuntime;

DotNetRuntimeStatsBuilder.Default().StartCollecting();

Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration(builder =>
Expand All @@ -21,14 +18,6 @@
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping
};
}))
.ConfigureServices(services =>
{
// prometheus counters metrics
services.AddPrometheusCounters();
services.AddPrometheusAspNetCoreMetrics();
services.AddPrometheusSqlClientMetrics();
services.AddPrometheusHttpClientMetrics();
})
.ConfigureWebHostDefaults(webHostBuilder =>
{
webHostBuilder.UseStartup<Startup>();
Expand Down

0 comments on commit 6c649e6

Please sign in to comment.