Skip to content

Commit 4338b9d

Browse files
authored
Version 6.1.0 - NET10 (#1110)
1 parent 3b9f08b commit 4338b9d

19 files changed

Lines changed: 284 additions & 18 deletions

CHANGELOG.MD

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ See also [releases](https://github.com/NLog/NLog.Web/releases) and [milestones](
44

55
Date format: (year/month/day)
66

7+
### Version 6.1.0 (2025/11/12)
8+
9+
- **NLog.Web.AspNetCore**
10+
- [#1110](https://github.com/NLog/NLog.Web/pull/1110) Added NET10 targetframework (@snakefoot)
11+
- [#1110](https://github.com/NLog/NLog.Web/pull/1110) aspnet-request-tls-handshake supporting NegotiatedCipherSuite + HostName (@snakefoot)
12+
713
### Version 6.0.5 (2025/11/09)
814

915
- **NLog.Web.AspNetCore**

NLog.Web.sln

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio Version 17
3-
VisualStudioVersion = 17.0.31903.59
2+
# Visual Studio Version 18
3+
VisualStudioVersion = 18.0.11205.157 d18.0
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{52CA242D-DB20-41D9-8B79-A5A965ECA105}"
66
ProjectSection(SolutionItems) = preProject
@@ -29,6 +29,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASP.NET.Core7", "examples\A
2929
EndProject
3030
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ASP.NET.Core8", "examples\ASP.NET.Core8\ASP.NET.Core8.csproj", "{7EBAAA50-E856-40DD-80F0-3A7515338A73}"
3131
EndProject
32+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ASP.NET.Core10", "examples\ASP.NET.Core10\ASP.NET.Core10.csproj", "{D020CBD7-274D-4508-BB47-52DC807A30BE}"
33+
EndProject
3234
Global
3335
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3436
Debug|Any CPU = Debug|Any CPU
@@ -66,6 +68,10 @@ Global
6668
{7EBAAA50-E856-40DD-80F0-3A7515338A73}.Debug|Any CPU.Build.0 = Debug|Any CPU
6769
{7EBAAA50-E856-40DD-80F0-3A7515338A73}.Release|Any CPU.ActiveCfg = Release|Any CPU
6870
{7EBAAA50-E856-40DD-80F0-3A7515338A73}.Release|Any CPU.Build.0 = Release|Any CPU
71+
{D020CBD7-274D-4508-BB47-52DC807A30BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
72+
{D020CBD7-274D-4508-BB47-52DC807A30BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
73+
{D020CBD7-274D-4508-BB47-52DC807A30BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
74+
{D020CBD7-274D-4508-BB47-52DC807A30BE}.Release|Any CPU.Build.0 = Release|Any CPU
6975
EndGlobalSection
7076
GlobalSection(SolutionProperties) = preSolution
7177
HideSolutionNode = FALSE
@@ -75,6 +81,7 @@ Global
7581
{C7F367FA-9DFC-4AA4-81AF-1B4933EAE516} = {A9FB260C-9052-45D3-827A-20590F9D2FEF}
7682
{88FE9FBA-774E-4425-A28D-3EBF385EEC2A} = {A9FB260C-9052-45D3-827A-20590F9D2FEF}
7783
{7EBAAA50-E856-40DD-80F0-3A7515338A73} = {A9FB260C-9052-45D3-827A-20590F9D2FEF}
84+
{D020CBD7-274D-4508-BB47-52DC807A30BE} = {A9FB260C-9052-45D3-827A-20590F9D2FEF}
7885
EndGlobalSection
7986
GlobalSection(ExtensibilityGlobals) = postSolution
8087
SolutionGuid = {B8468549-60D6-49AC-A6F7-44391E4C392C}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Extensions for [NLog](https://github.com/NLog/NLog/) that includes [layout-rende
2222
For updates and releases, check [CHANGELOG.MD](CHANGELOG.MD) or [Releases](https://github.com/NLog/NLog.Web/releases)
2323

2424
## ASP.NET Core
25-
The [NLog.Web.AspNetCore](https://www.nuget.org/packages/NLog.Web.AspNetCore)-package works with the new ASP.NET Core platforms .NET 6, 7, 8 and 9
25+
The [NLog.Web.AspNetCore](https://www.nuget.org/packages/NLog.Web.AspNetCore)-package works with the new ASP.NET Core platforms .NET 6, 7, 8, 9 and 10
2626

2727
- [Getting started for ASP.NET Core 6](https://github.com/NLog/NLog/wiki/Getting-started-with-ASP.NET-Core-6)
2828
- [Getting started for ASP.NET Core 5](https://github.com/NLog/NLog/wiki/Getting-started-with-ASP.NET-Core-5)

appveyor.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ nuget:
88
project_feed: true
99
matrix:
1010
fast_finish: true
11+
install:
12+
- ps: |
13+
Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -UseBasicParsing -OutFile "$env:temp\dotnet-install.ps1"
14+
& $env:temp\dotnet-install.ps1 -Architecture x64 -Version '10.0.100' -InstallDir "$env:ProgramFiles\dotnet"
1115
build:
1216
publish_nuget: true
1317
publish_nuget_symbols: true

build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# creates NuGet package at \artifacts
33
dotnet --version
44

5-
$versionPrefix = "6.0.6"
5+
$versionPrefix = "6.1.0"
66
$versionSuffix = ""
77
$versionFile = $versionPrefix + "." + ${env:APPVEYOR_BUILD_NUMBER}
88
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<InvariantGlobalization>true</InvariantGlobalization>
8+
<PublishAot>true</PublishAot>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<ProjectReference Include="..\..\src\NLog.Web.AspNetCore\NLog.Web.AspNetCore.csproj" />
13+
</ItemGroup>
14+
15+
</Project>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@ASP.NET.Core10_HostAddress = http://localhost:5252
2+
3+
GET {{ASP.NET.Core10_HostAddress}}/todos/
4+
Accept: application/json
5+
6+
###
7+
8+
GET {{ASP.NET.Core10_HostAddress}}/todos/1
9+
Accept: application/json
10+
11+
###

examples/ASP.NET.Core10/Program.cs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using System.Text.Json.Serialization;
2+
using Microsoft.AspNetCore.Http.HttpResults;
3+
using NLog.Web;
4+
5+
var builder = WebApplication.CreateSlimBuilder(args);
6+
7+
// Setup NLog for Logging
8+
await using var nlogFactory = NLog.LogManager.LogFactory; // async flush/shutdown on dispose
9+
builder.Logging.ClearProviders();
10+
builder.UseNLog();
11+
12+
builder.Services.ConfigureHttpJsonOptions(options =>
13+
{
14+
options.SerializerOptions.TypeInfoResolverChain.Insert(0, AppJsonSerializerContext.Default);
15+
});
16+
17+
var app = builder.Build();
18+
19+
Todo[] sampleTodos =
20+
[
21+
new(1, "Walk the dog"),
22+
new(2, "Do the dishes", DateOnly.FromDateTime(DateTime.Now)),
23+
new(3, "Do the laundry", DateOnly.FromDateTime(DateTime.Now.AddDays(1))),
24+
new(4, "Clean the bathroom"),
25+
new(5, "Clean the car", DateOnly.FromDateTime(DateTime.Now.AddDays(2)))
26+
];
27+
28+
var todosApi = app.MapGroup("/todos");
29+
todosApi.MapGet("/", (ILogger<Todo> logger) =>
30+
{
31+
logger.LogInformation("GET Todos {TodoListCount} items", sampleTodos.Length);
32+
return sampleTodos;
33+
});
34+
35+
todosApi.MapGet("/{id}", Results<Ok<Todo>, NotFound> (int id) =>
36+
sampleTodos.FirstOrDefault(a => a.Id == id) is { } todo
37+
? TypedResults.Ok(todo)
38+
: TypedResults.NotFound());
39+
40+
app.Run();
41+
42+
public record Todo(int Id, string? Title, DateOnly? DueBy = null, bool IsComplete = false);
43+
44+
[JsonSerializable(typeof(Todo[]))]
45+
internal partial class AppJsonSerializerContext : JsonSerializerContext
46+
{
47+
48+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "https://json.schemastore.org/launchsettings.json",
3+
"profiles": {
4+
"http": {
5+
"commandName": "Project",
6+
"dotnetRunMessages": true,
7+
"launchBrowser": true,
8+
"launchUrl": "todos",
9+
"applicationUrl": "http://localhost:5252",
10+
"environmentVariables": {
11+
"ASPNETCORE_ENVIRONMENT": "Development"
12+
}
13+
}
14+
}
15+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
}
8+
}

0 commit comments

Comments
 (0)