Skip to content

Commit 3a245e4

Browse files
committed
.net 7 upgrade
1 parent a6ce6e1 commit 3a245e4

File tree

18 files changed

+24397
-139
lines changed

18 files changed

+24397
-139
lines changed

.github/workflows/sts-azure-app.yml_distabled

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
env:
1616
AZURE_WEBAPP_NAME: aspnetcorests # set this to your application's name
1717
AZURE_WEBAPP_PACKAGE_PATH: "." # set this to the path to your web app project, defaults to the repository root
18-
DOTNET_VERSION: "6.0.100" # set this to the dot net version to use
18+
DOTNET_VERSION: "7.0.100" # set this to the dot net version to use
1919

2020
jobs:
2121
build-and-deploy:

.github/workflows/sts-vm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Setup .NET Core
1515
uses: actions/setup-dotnet@v1
1616
with:
17-
dotnet-version: 6.0.100
17+
dotnet-version: 7.0.100
1818
- name: Build
1919
run: dotnet build AspNetCoreSpa.sln --configuration Release
2020
- name: Test

.github/workflows/web-vm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Setup .NET Core
1515
uses: actions/setup-dotnet@v1
1616
with:
17-
dotnet-version: 6.0.100
17+
dotnet-version: 7.0.100
1818
- uses: actions/cache@v1
1919
with:
2020
path: ~/.npm

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"type": "coreclr",
1010
"request": "launch",
1111
"preLaunchTask": "build",
12-
"program": "${workspaceFolder}/src/Presentation/Web/bin/Debug/net6.0/AspNetCoreSpa.Web.dll",
12+
"program": "${workspaceFolder}/src/Presentation/Web/bin/Debug/net7.0/AspNetCoreSpa.Web.dll",
1313
"args": [],
1414
"cwd": "${workspaceFolder}/src/Presentation/Web",
1515
"stopAtEntry": false,
@@ -29,7 +29,7 @@
2929
"type": "coreclr",
3030
"request": "launch",
3131
"preLaunchTask": "buildsts",
32-
"program": "${workspaceFolder}/src/Presentation/STS/bin/Debug/net6.0/AspNetCoreSpa.STS.dll",
32+
"program": "${workspaceFolder}/src/Presentation/STS/bin/Debug/net7.0/AspNetCoreSpa.STS.dll",
3333
"args": [],
3434
"cwd": "${workspaceFolder}/src/Presentation/STS",
3535
"stopAtEntry": false,

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
## Features
88

9-
- [ASP.NET Core 6.0](http://www.dot.net/)
10-
- [Entity Framework Core 6.0](https://docs.efproject.net/en/latest/)
9+
- [ASP.NET Core 7.0](http://www.dot.net/)
10+
- [Entity Framework Core 7.0](https://docs.efproject.net/en/latest/)
1111
- Both Sql Server and Sql lite databases are supported (Check installation instrcutions for more details)
1212
- [Identity Server 4](http://identityserver.io/)
13-
- [Angular 11](https://angular.io/)
14-
- [Angular CLI 11](https://cli.angular.io/)
13+
- [Angular 15](https://angular.io/)
14+
- [Angular CLI 15](https://cli.angular.io/)
1515
- Secure - with CSP and custom security headers
1616
- [SignalR](https://github.com/aspnet/SignalR/)
1717
- [SASS](http://sass-lang.com/)
@@ -29,7 +29,7 @@
2929

3030
## Pre-requisites
3131

32-
1. [.Net 6.0 SDK](https://www.microsoft.com/net/core#windows)
32+
1. [.Net 7.0 SDK](https://www.microsoft.com/net/core#windows)
3333
2. [Visual studio 2019](https://www.visualstudio.com/) OR [VSCode](https://code.visualstudio.com/) with [C#](https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp) extension
3434
3. [NodeJs](https://nodejs.org/en/) (Latest LTS)
3535
4. [Microsoft SQL Server](https://www.microsoft.com/en-us/sql-server) (Optional: If MS SQL server required instead of Sqlite during development)
@@ -207,7 +207,7 @@ From powershell:
207207
### Replace your app name where it is `aspnetcorespa`
208208

209209
- dotnet publish -c release
210-
- docker build -t aspnetcorespa ./bin/release/net6.0/publish
210+
- docker build -t aspnetcorespa ./bin/release/net7.0/publish
211211
- heroku login
212212
- heroku container:login
213213
- docker tag aspnetcorespa registry.heroku.com/aspnetcorespa/web

azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ steps:
1919
displayName: Install Nuget
2020

2121
- task: UseDotNet@2
22-
displayName: Install 6.0.x
22+
displayName: Install 7.0.x
2323
inputs:
24-
version: "6.0.x"
24+
version: "7.0.x"
2525

2626
- task: NuGetCommand@2
2727
displayName: Restore

src/Core/Application/Application.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<RootNamespace>AspNetCoreSpa.Application</RootNamespace>
66
<AssemblyName>AspNetCoreSpa.Application</AssemblyName>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
11-
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.0" />
12-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
13-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
14-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
15-
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
16-
<PackageReference Include="AutoMapper" Version="10.1.1" />
17-
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.1" />
18-
<PackageReference Include="FluentValidation" Version="10.3.4" />
19-
<PackageReference Include="FluentValidation.AspNetCore" Version="10.3.4" />
20-
<PackageReference Include="MediatR" Version="9.0.0" />
21-
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" />
10+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
11+
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
12+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
13+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0" />
14+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
15+
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
16+
<PackageReference Include="AutoMapper" Version="11.0.0" />
17+
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="11.0.0" />
18+
<PackageReference Include="FluentValidation" Version="11.4.0" />
19+
<PackageReference Include="FluentValidation.AspNetCore" Version="11.2.2" />
20+
<PackageReference Include="MediatR" Version="11.1.0" />
21+
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="11.0.0" />
2222
</ItemGroup>
2323

2424
<ItemGroup>

src/Core/Application/Behaviours/RequestPerformanceBehaviour.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace AspNetCoreSpa.Application.Behaviours
99
{
1010
public class RequestPerformanceBehaviour<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse>
11+
where TRequest : IRequest<TResponse>
1112
{
1213
private readonly Stopwatch _timer;
1314
private readonly ILogger<TRequest> _logger;
@@ -21,7 +22,7 @@ public RequestPerformanceBehaviour(ILogger<TRequest> logger, ICurrentUserService
2122
_currentUserService = currentUserService;
2223
}
2324

24-
public async Task<TResponse> Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate<TResponse> next)
25+
public async Task<TResponse> Handle(TRequest request, RequestHandlerDelegate<TResponse> next, CancellationToken cancellationToken)
2526
{
2627
_timer.Start();
2728

@@ -33,7 +34,7 @@ public async Task<TResponse> Handle(TRequest request, CancellationToken cancella
3334
{
3435
var name = typeof(TRequest).Name;
3536

36-
_logger.LogWarning("AspNetCoreSpa Long Running Request: {Name} ({ElapsedMilliseconds} milliseconds) {@UserId} {@Request}",
37+
_logger.LogWarning("AspNetCoreSpa Long Running Request: {Name} ({ElapsedMilliseconds} milliseconds) {@UserId} {@Request}",
3738
name, _timer.ElapsedMilliseconds, _currentUserService.UserId, request);
3839
}
3940

src/Core/Application/Behaviours/RequestValidationBehavior.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public RequestValidationBehavior(IEnumerable<IValidator<TRequest>> validators)
1818
_validators = validators;
1919
}
2020

21-
public Task<TResponse> Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate<TResponse> next)
21+
public Task<TResponse> Handle(TRequest request, RequestHandlerDelegate<TResponse> next, CancellationToken cancellationToken)
2222
{
2323
var context = new ValidationContext<TRequest>(request);
2424

src/Core/Common/Common.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>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<RootNamespace>AspNetCoreSpa.Common</RootNamespace>
66
<AssemblyName>AspNetCoreSpa.Common</AssemblyName>
77
</PropertyGroup>

0 commit comments

Comments
 (0)