Skip to content

Commit 64afd92

Browse files
committed
Update to .NET 10 and centralize package management
1 parent 7a3f32f commit 64afd92

File tree

15 files changed

+62
-56
lines changed

15 files changed

+62
-56
lines changed

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Install .NET Core
3434
uses: actions/setup-dotnet@v5
3535
with:
36-
dotnet-version: 9.x
36+
dotnet-version: 10.x
3737

3838
- name: Restore Dependencies
3939
run: dotnet restore

AspNetCore.SecurityKey.slnx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Solution>
22
<Folder Name="/Build/">
33
<File Path=".github/workflows/dotnet.yml" />
4+
<File Path="Directory.Packages.props" />
45
<File Path="README.md" />
56
<File Path="src/Directory.Build.props" />
67
</Folder>
@@ -12,7 +13,6 @@
1213
<Project Path="samples/Sample.Shared/Sample.Shared.csproj" />
1314
</Folder>
1415
<Folder Name="/Tests/">
15-
<File Path="test/Directory.Build.props" />
1616
<Project Path="test/AspNetCore.SecurityKey.Tests/AspNetCore.SecurityKey.Tests.csproj" />
1717
</Folder>
1818
<Project Path="src/AspNetCore.SecurityKey/AspNetCore.SecurityKey.csproj" />

Directory.Packages.props

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<PackageVersion Include="AssemblyMetadata.Generators" Version="2.1.0" />
8+
<PackageVersion Include="Bogus" Version="35.6.5" />
9+
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
10+
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0" />
11+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
12+
<PackageVersion Include="MinVer" Version="6.0.0" />
13+
<PackageVersion Include="Scalar.AspNetCore" Version="2.10.3" />
14+
<PackageVersion Include="Swashbuckle.AspNetCore" Version="10.0.0" />
15+
<PackageVersion Include="xunit" Version="2.9.3" />
16+
<PackageVersion Include="XUnit.Hosting" Version="3.1.0" />
17+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
18+
<PackageVersion Include="xunit.v3" Version="3.2.0" />
19+
</ItemGroup>
20+
</Project>

samples/Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
</PropertyGroup>
2525

2626
<ItemGroup>
27-
<PackageReference Include="AssemblyMetadata.Generators" Version="2.1.0" PrivateAssets="All" />
28-
<PackageReference Include="Bogus" Version="35.6.5" />
29-
<PackageReference Include="MinVer" Version="6.0.0" PrivateAssets="All" />
27+
<PackageReference Include="AssemblyMetadata.Generators" PrivateAssets="All" />
28+
<PackageReference Include="Bogus" />
29+
<PackageReference Include="MinVer" PrivateAssets="All" />
3030
</ItemGroup>
3131

3232
<ItemGroup>

samples/Sample.Controllers/Sample.Controllers.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.6" />
10+
<PackageReference Include="Swashbuckle.AspNetCore" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

samples/Sample.Middleware/Sample.Middleware.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.10" />
11-
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.6" />
10+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" />
11+
<PackageReference Include="Swashbuckle.AspNetCore" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

samples/Sample.MinimalApi/Program.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,14 @@ public static void Main(string[] args)
3333
app.UseAuthorization();
3434

3535
app.MapGet("/weather", () => WeatherFaker.Instance.Generate(5))
36-
.WithName("GetWeatherForecast")
37-
.WithOpenApi();
36+
.WithName("GetWeatherForecast");
3837

3938
app.MapGet("/users", () => UserFaker.Instance.Generate(10))
4039
.WithName("GetUsers")
41-
.WithOpenApi()
4240
.RequireSecurityKey();
4341

4442
app.MapGet("/addresses", () => AddressFaker.Instance.Generate(10))
4543
.WithName("GetAddresses")
46-
.WithOpenApi()
4744
.RequireAuthorization();
4845

4946
app.MapGet("/current", (ClaimsPrincipal? principal) =>
@@ -54,8 +51,7 @@ public static void Main(string[] args)
5451
Data = WeatherFaker.Instance.Generate(5)
5552
};
5653
})
57-
.WithName("GetCurrentUser")
58-
.WithOpenApi();
54+
.WithName("GetCurrentUser");
5955

6056
app.MapOpenApi();
6157
app.MapScalarApiReference();

samples/Sample.MinimalApi/Sample.MinimalApi.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.10" />
11-
<PackageReference Include="Scalar.AspNetCore" Version="2.10.3" />
10+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" />
11+
<PackageReference Include="Scalar.AspNetCore" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

samples/Sample.Shared/Sample.Shared.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">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net8.0;net9.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net8.0;net9.0;net10.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
@@ -10,8 +10,8 @@
1010
<FrameworkReference Include="Microsoft.AspNetCore.App" />
1111
</ItemGroup>
1212

13-
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
14-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.10" />
13+
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
14+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" />
1515
</ItemGroup>
1616

1717
</Project>

0 commit comments

Comments
 (0)