Skip to content

Commit a2a6317

Browse files
neoscieGitHub Release BotCopilot
authored
Add DotNetConsoleLogger (#25)
- Introduces DotNetConsoleLogger for fallback logging. - Adds a CI check to validate DI setup using `check-deps` to ensure proper dependency resolution and prevent runtime errors. - Upgrades dependency packages to their latest versions. --------- Co-authored-by: GitHub Release Bot <release-bot@neolution.ch> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 4014304 commit a2a6317

29 files changed

Lines changed: 516 additions & 238 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,8 @@ jobs:
2828
- name: Build
2929
run: dotnet build --no-restore --configuration '${{ env.BUILD_CONFIGURATION }}'
3030

31+
- name: Run check-deps in Demo Application
32+
run: dotnet run --project Neolution.DotNet.Console.Demo --no-build --configuration '${{ env.BUILD_CONFIGURATION }}' -- check-deps
33+
3134
- name: Test
3235
run: dotnet test --no-build --verbosity normal --configuration '${{ env.BUILD_CONFIGURATION }}'

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Added `DotNetConsoleLogger.cs` static class to provide initialization, access, and shutdown for the logger instance used in console applications.
13+
14+
### Changed
15+
16+
- Updated Scrutor to v6.1.0.
17+
- Updated Microsoft.Extensions packages to latest patch versions.
18+
19+
### Removed
20+
21+
- Removed obsolete serialization constructor and `[Serializable]` attribute from `DotNetConsoleException` as formatter-based serialization is no longer supported or recommended in modern .NET.
22+
1023
## [5.0.0] - 2025-01-27
1124

1225
### Added

Neolution.DotNet.Console.SampleAsync/Commands/Echo/EchoCommand.cs renamed to Neolution.DotNet.Console.Demo/Commands/Echo/EchoCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Neolution.DotNet.Console.SampleAsync.Commands.Echo
1+
namespace Neolution.DotNet.Console.Demo.Commands.Echo
22
{
33
using System;
44
using Microsoft.Extensions.Configuration;

Neolution.DotNet.Console.SampleAsync/Commands/Echo/EchoOptions.cs renamed to Neolution.DotNet.Console.Demo/Commands/Echo/EchoOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Neolution.DotNet.Console.SampleAsync.Commands.Echo
1+
namespace Neolution.DotNet.Console.Demo.Commands.Echo
22
{
33
using CommandLine;
44

Neolution.DotNet.Console.SampleAsync/Commands/GuidGen/GuidGenCommand.cs renamed to Neolution.DotNet.Console.Demo/Commands/GuidGen/GuidGenCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Neolution.DotNet.Console.SampleAsync.Commands.GuidGen
1+
namespace Neolution.DotNet.Console.Demo.Commands.GuidGen
22
{
33
using System;
44
using System.Globalization;
@@ -41,7 +41,7 @@ public Task RunAsync(GuidGenOptions options, CancellationToken cancellationToken
4141
result = result.ToUpperInvariant();
4242
}
4343

44-
System.Console.WriteLine(result);
44+
Console.WriteLine(result);
4545

4646
this.logger.LogTrace("Wrote result to console");
4747
return Task.CompletedTask;

Neolution.DotNet.Console.SampleAsync/Commands/GuidGen/GuidGenOptions.cs renamed to Neolution.DotNet.Console.Demo/Commands/GuidGen/GuidGenOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
namespace Neolution.DotNet.Console.SampleAsync.Commands.GuidGen
1+
namespace Neolution.DotNet.Console.Demo.Commands.GuidGen
22
{
33
using CommandLine;
4-
using Neolution.DotNet.Console.SampleAsync.Commands.Echo;
4+
using Neolution.DotNet.Console.Demo.Commands.Echo;
55

66
/// <summary>
77
/// The options for the <see cref="EchoCommand"/>.

Neolution.DotNet.Console.SampleAsync/Commands/Start/StartCommand.cs renamed to Neolution.DotNet.Console.Demo/Commands/Start/StartCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Neolution.DotNet.Console.SampleAsync.Commands.Start
1+
namespace Neolution.DotNet.Console.Demo.Commands.Start
22
{
33
using System;
44
using Microsoft.Extensions.Logging;

Neolution.DotNet.Console.SampleAsync/Commands/Start/StartOptions.cs renamed to Neolution.DotNet.Console.Demo/Commands/Start/StartOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Neolution.DotNet.Console.SampleAsync.Commands.Start
1+
namespace Neolution.DotNet.Console.Demo.Commands.Start
22
{
33
using CommandLine;
44

Neolution.DotNet.Console.SampleAsync/Dockerfile renamed to Neolution.DotNet.Console.Demo/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ RUN dotnet publish -c Release -o out
1212
FROM mcr.microsoft.com/dotnet/runtime:6.0
1313
WORKDIR /app
1414
COPY --from=build-env /app/out .
15-
ENTRYPOINT ["dotnet", "Neolution.DotNet.Console.SampleAsync.dll"]
15+
ENTRYPOINT ["dotnet", "Neolution.DotNet.Console.Demo.dll"]

Neolution.DotNet.Console.SampleAsync/Neolution.DotNet.Console.SampleAsync.csproj renamed to Neolution.DotNet.Console.Demo/Neolution.DotNet.Console.Demo.csproj

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

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
@@ -11,7 +11,7 @@
1111
<ItemGroup>
1212
<PackageReference Include="CommandLineParser" Version="2.9.1" />
1313
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.1" />
14-
<PackageReference Include="Neolution.CodeAnalysis" Version="3.2.1">
14+
<PackageReference Include="Neolution.CodeAnalysis" Version="3.3.0-beta.2">
1515
<PrivateAssets>all</PrivateAssets>
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1717
</PackageReference>

0 commit comments

Comments
 (0)