Skip to content
This repository was archived by the owner on Aug 30, 2025. It is now read-only.

Commit 2c1c0d3

Browse files
committed
feat: Added support to .NET8
1 parent 97a0dc6 commit 2c1c0d3

10 files changed

Lines changed: 42 additions & 38 deletions

File tree

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ jobs:
4848
# If you wish to specify custom queries, you can do so here or in a config file.
4949
# By default, queries listed here will override any specified in a config file.
5050
# Prefix the list here with "+" to use these queries and those in the config file.
51-
51+
5252
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
5353
# queries: security-extended,security-and-quality
5454

55-
55+
5656
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5757
# If this step fails, then you should remove it and run the build manually (see below)
5858
- name: Autobuild
@@ -61,7 +61,7 @@ jobs:
6161
# ℹ️ Command-line programs to run using the OS shell.
6262
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
6363

64-
# If the Autobuild fails above, remove it and uncomment the following three lines.
64+
# If the Autobuild fails above, remove it and uncomment the following three lines.
6565
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
6666

6767
# - run: |

.github/workflows/mutation-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ on:
1818

1919

2020
env:
21-
SDK_VERSION: '7.0.400'
22-
FRAMEWORK_VERSION: 'net7.0'
21+
SDK_VERSION: '8.0.303'
22+
FRAMEWORK_VERSION: 'net8.0'
2323

2424
GIT_ORGANIZATION: 'TechNobre'
2525
PROJECT_NAME: 'PowerUtils.AspNetCore.ErrorHandler'

.github/workflows/nuget-vulnerabilites.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515

1616

1717
env:
18-
SDK_VERSION: '7.0.400'
18+
SDK_VERSION: '8.0.303'
1919

2020

2121
jobs:

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313

1414

1515
env:
16-
SDK_VERSION: '7.0.400'
16+
SDK_VERSION: '8.0.303'
1717
PACKAGE_PATH: ./src/**/*.nupkg
1818
NUGET_SERVER: https://api.nuget.org/v3/index.json
1919

.github/workflows/sonarcloud.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515

1616

1717
env:
18-
SDK_VERSION: '7.0.400'
18+
SDK_VERSION: '8.0.303'
1919

2020

2121
jobs:

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111

1212

1313
env:
14+
SDK_VERSION_8: '8.0.303'
1415
SDK_VERSION_7: '7.0.400'
1516
SDK_VERSION_6: '6.0.413'
1617
SDK_VERSION_5: '5.0.408'
@@ -36,6 +37,7 @@ jobs:
3637
uses: actions/setup-dotnet@v4
3738
with:
3839
dotnet-version: |
40+
${{ env.SDK_VERSION_8 }}
3941
${{ env.SDK_VERSION_7 }}
4042
${{ env.SDK_VERSION_6 }}
4143
${{ env.SDK_VERSION_5 }}

README.md

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,39 +17,38 @@
1717
[![License: MIT](https://img.shields.io/github/license/TechNobre/PowerUtils.AspNetCore.ErrorHandler.svg)](https://github.com/TechNobre/PowerUtils.AspNetCore.ErrorHandler/blob/main/LICENSE)
1818

1919

20-
- [Support](#support-to)
20+
- [Support to](#support-to)
2121
- [Dependencies](#dependencies)
2222
- [How to use](#how-to-use)
23-
- [Install NuGet package](#Installation)
24-
- [Configure](#ErrorHandler.Configure)
25-
- [PropertyNamingPolicy](#ErrorHandler.PropertyNamingPolicy)
26-
- [ExceptionMappers](#ErrorHandler.ExceptionMappers)
27-
- [IProblemFactory](#ErrorHandler.IProblemFactory)
28-
- [Customize problem link and problem title](#ErrorHandler.CustomizeLinkAndTitle)
29-
- [Add new custom status code](#ErrorHandler.CustomizeLinkAndTitle.AddNew)
30-
- [Change link and title for a specific status code](#ErrorHandler.CustomizeLinkAndTitle.Change)
31-
- [Contribution](#contribution)
32-
- [License](./LICENSE)
33-
- [Changelog](./CHANGELOG.md)
23+
- [Install NuGet package](#install-nuget-package)
24+
- [Configure](#configure)
25+
- [PropertyNamingPolicy](#propertynamingpolicy)
26+
- [ExceptionMappers](#exceptionmappers)
27+
- [IProblemFactory](#iproblemfactory)
28+
- [Customize problem link and problem title](#customize-problem-link-and-problem-title)
29+
- [Add new custom status code](#add-new-custom-status-code)
30+
- [Change link and title for a specific status code](#change-link-and-title-for-a-specific-status-code)
31+
- [Contribution ](#contribution-)
3432

3533

3634

37-
## Support to <a name="support-to"></a>
35+
## Support to<a name="support-to"></a>
36+
- .NET 8.0
3837
- .NET 7.0
3938
- .NET 6.0
4039
- .NET 5.0
4140

4241

4342

44-
## Dependencies <a name="dependencies"></a>
43+
## Dependencies<a name="dependencies"></a>
4544

4645
- Microsoft.AspNetCore.App [NuGet](https://www.nuget.org/packages/Microsoft.AspNetCore.App/)
4746

4847

4948

50-
## How to use <a name="how-to-use"></a>
49+
## How to use<a name="how-to-use"></a>
5150

52-
### Install NuGet package <a name="Installation"></a>
51+
### Install NuGet package<a name="Installation"></a>
5352
This package is available through Nuget Packages: https://www.nuget.org/packages/PowerUtils.AspNetCore.ErrorHandler
5453

5554
**Nuget**
@@ -62,7 +61,7 @@ Install-Package PowerUtils.AspNetCore.ErrorHandler
6261
dotnet add package PowerUtils.AspNetCore.ErrorHandler
6362
```
6463

65-
### Configure <a name="ErrorHandler.Configure"></a>
64+
### Configure<a name="ErrorHandler.Configure"></a>
6665

6766
ErrorHandler configuration
6867

@@ -82,7 +81,7 @@ public class Startup
8281
```
8382

8483

85-
#### PropertyNamingPolicy <a name="ErrorHandler.PropertyNamingPolicy"></a>
84+
#### PropertyNamingPolicy<a name="ErrorHandler.PropertyNamingPolicy"></a>
8685
**Options:**
8786
- **Original**: _Do not format the property_;
8887
- **CamelCase**: E.g. from `ClientName` to `clientName` **Default value**;
@@ -102,7 +101,7 @@ public class Startup
102101
```
103102

104103

105-
#### ExceptionMappers <a name="ErrorHandler.ExceptionMappers"></a>
104+
#### ExceptionMappers<a name="ErrorHandler.ExceptionMappers"></a>
106105
Exception mapping to status code and error codes
107106

108107
```csharp
@@ -128,7 +127,7 @@ public class Startup
128127
```
129128

130129

131-
#### IProblemFactory <a name="ErrorHandler.IProblemFactory"></a>
130+
#### IProblemFactory<a name="ErrorHandler.IProblemFactory"></a>
132131
How to create a custom error problem details for example in a controller
133132

134133
```csharp
@@ -177,10 +176,10 @@ public class HomeController : ControllerBase
177176
```
178177

179178

180-
#### Customize problem link and problem title <a name="ErrorHandler.CustomizeLinkAndTitle"></a>
179+
#### Customize problem link and problem title<a name="ErrorHandler.CustomizeLinkAndTitle"></a>
181180
Exception mapping to status code and error codes
182181

183-
##### Add new custom status code <a name="ErrorHandler.CustomizeLinkAndTitle.AddNew"></a>
182+
##### Add new custom status code<a name="ErrorHandler.CustomizeLinkAndTitle.AddNew"></a>
184183
```csharp
185184
public class Startup
186185
{
@@ -198,7 +197,7 @@ public class Startup
198197
}
199198
```
200199

201-
##### Change link and title for a specific status code <a name="ErrorHandler.CustomizeLinkAndTitle.Change"></a>
200+
##### Change link and title for a specific status code<a name="ErrorHandler.CustomizeLinkAndTitle.Change"></a>
202201

203202
Add your customization after `services.AddErrorHandler();` because it will override the defaults status codes
204203
```csharp
@@ -220,4 +219,4 @@ public class Startup
220219

221220
## Contribution <a name="contribution"></a>
222221

223-
If you have any questions, comments, or suggestions, please open an [issue](https://github.com/TechNobre/PowerUtils.AspNetCore.ErrorHandler/issues/new/choose) or create a [pull request](https://github.com/TechNobre/PowerUtils.AspNetCore.ErrorHandler/compare)
222+
If you have any questions, comments, or suggestions, please open an [issue](https://github.com/TechNobre/PowerUtils.AspNetCore.ErrorHandler/issues/new/choose) or create a [pull request](https://github.com/TechNobre/PowerUtils.AspNetCore.ErrorHandler/compare)

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "7.0.400"
3+
"version": "8.0.303"
44
}
5-
}
5+
}

src/PowerUtils.AspNetCore.ErrorHandler.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<PropertyGroup>
55
<ProjectGuid>848b072c-e1a1-4fcf-b00a-f14750be758b</ProjectGuid>
66

7-
<TargetFrameworks>net5.0;net6.0;net7.0</TargetFrameworks>
7+
<TargetFrameworks>net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
88

99

1010
<AssemblyName>PowerUtils.AspNetCore.ErrorHandler</AssemblyName>

tests/PowerUtils.AspNetCore.ErrorHandler.Tests/PowerUtils.AspNetCore.ErrorHandler.Tests.csproj

Lines changed: 6 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>net5.0;net6.0;net7.0</TargetFrameworks>
4+
<TargetFrameworks>net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
55

66
<RootNamespace>PowerUtils.AspNetCore.ErrorHandler.Tests</RootNamespace>
77
<AssemblyName>PowerUtils.AspNetCore.ErrorHandler.Tests</AssemblyName>
@@ -46,11 +46,14 @@
4646
</PackageReference>
4747
</ItemGroup>
4848

49+
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
50+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.7" />
51+
</ItemGroup>
4952
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
50-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.16" />
53+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.20" />
5154
</ItemGroup>
5255
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
53-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="[6.0.27]" allowedVersions="[6.0.27]" />
56+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="[6.0.32]" allowedVersions="[6.0.32]" />
5457
</ItemGroup>
5558
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
5659
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="[5.0.17]" allowedVersions="[5.0.17]" />

0 commit comments

Comments
 (0)