Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set console color with .net core in OSX

I'm playing around with .NET core 1.0 on OSX 10.11.5 (El Capitan). Simply changing Console.ForegroundColor seems to have no impact on the console text color from the command line.

     Console.ForegroundColor = ConsoleColor.Yellow;
     Console.WriteLine("Yellow");

I tried updating my bash config

export CLICOLOR=1

Is there anything else I should be doing?

like image 362
Jason Avatar asked Oct 31 '22 00:10

Jason


1 Answers

I figured this out. It is a difference between .NET core 1.0 versions. I didn't realize the suffix until running

dotnet --version

Previously I had:

1.0.0-preview1-002702

After re-downloading and installing the SDX, I now have:

1.0.0-preview2-003121

This must have been a bug that the team corrected.

Thanks all.

like image 191
Jason Avatar answered Nov 15 '22 05:11

Jason