I am trying to change the colour of my Console.WriteLine()
text, but it's not working as expected. My code (in my WPF page constructor, but I've tried the same code elsewhere):
Console.BackgroundColor = ConsoleColor.Magenta;
Console.ForegroundColor = ConsoleColor.Yellow;
Console.Write("sdfsgfsd");
Console.WriteLine("sdgdsfg");
My text displays in the Output window, but in the usual grey on black console colours.
Is my code incorrect (I've seen several examples online that use the same method)? Or perhaps there is something in my Visual Studio setup that is incompatible? I've reset the console colour settings to the defaults with no effect.
This is VS Community 2019 with all available updates, using C# in a WPF project.