❔ ✅ 'ConsoleColor' does not contain a definition for 'DrawingColor'
I am experimenting a sample code to create a colourful UI on console, and am getting this error:
`
My current code is here https://pastebin.com/tHvqkYLu
Could anyone kindly help me with some clues or hints? I have tried System.Drawing.Color or just the name of the color like Cyan, none of these worked.
Pastebin
UI_Console_DUP - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
9 Replies
color.Value.DrawingColor().Name
color
is of type ConsoleColor
Well, ConsoleColor?
You're pulling out it's value with .Value
(without even checking if that value exists in the first place, by the by)
So you get ConsoleColor
ConsoleColor Enum (System)
Specifies constants that define foreground and background colors for the console.
It's an enum
It doesn't have methods
No such thing as
ConsoleColor.DrawingColor()
existsThanks a lot - I think I had a bad code example, this code isn't mine (although it came from the ASP.NET 2.0 era whilst I use NET 6.0 ) So there is a lot of discrepancies, I had to change a lot of source codes from this book a lot. Like I try to find a way with a blindfold. I am pretty sure there is a good example on the web, see if I find out the correct course like Udemy
Yeah, don't use learning resources this outdated
I will try maybe FreeCodeCamp etc, a lot of people recommend me that
$helloworld
Written interactive course https://learn.microsoft.com/en-us/users/dotnet/collections/yz26f8y64n7k07
Videos https://dotnet.microsoft.com/learn/videos
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.