I’m trying to create a .NET 8 Windows Service.
Have followed this guide:
https://learn.microsoft.com/en-us/dotnet/core/extensions/windows-service
All is good until I try to start it, Event Viewer reveals it has thrown an I/O error:
Application: dotnet.exe
CoreCLR Version: 8.0.724.31311
.NET Version: 8.0.7
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.IOException: The handle is invalid.
at System.ConsolePal.SetConsoleOutputEncoding(Encoding enc)
at System.Console.set_OutputEncoding(Encoding value)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
Has anyone experienced this and solved?