From 576801c14110608d4255dd16631b85e25b0e8c09 Mon Sep 17 00:00:00 2001 From: erwan-joly Date: Mon, 31 Aug 2026 02:13:43 +1200 Subject: [PATCH] chore: take the console title helper from NosCore.Shared try { Console.Title = Title; } catch (PlatformNotSupportedException) { } was guessing at a state the package can now answer: 6.0.2 ships ConsoleHelper, which asks whether this process owns a console before touching the title. The catch was also aimed at the wrong exception - the throw on a process with no console attached is an IOException, so it never caught anything here. Tested: builds with 0 warnings. --- src/NosCore.Injector/NosCore.Injector.csproj | 2 +- src/NosCore.Injector/Program.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/NosCore.Injector/NosCore.Injector.csproj b/src/NosCore.Injector/NosCore.Injector.csproj index 146780a..f5304eb 100644 --- a/src/NosCore.Injector/NosCore.Injector.csproj +++ b/src/NosCore.Injector/NosCore.Injector.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/NosCore.Injector/Program.cs b/src/NosCore.Injector/Program.cs index 243aa19..7bf1010 100644 --- a/src/NosCore.Injector/Program.cs +++ b/src/NosCore.Injector/Program.cs @@ -10,6 +10,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using NosCore.Shared.Configuration; +using NosCore.Shared.Helpers; using NosCore.Shared.I18N; using Serilog; @@ -26,7 +27,7 @@ public static void Main(string[] args) public static IHostBuilder CreateHostBuilder(string[] args) { var injectorConfiguration = new InjectorConfiguration(); - try { Console.Title = Title; } catch (PlatformNotSupportedException) { } + ConsoleHelper.SetTitle(Title); var configuration = ConfiguratorBuilder.InitializeConfiguration(args, new[] { "injector.yml", "logger.yml" }); LogLanguage.Language = injectorConfiguration.Language;