Feature ‘collection expressions’ is not available in C# 11.0. Please use language version 12.0 or greater.CS9058
I keep seeing this error above whenever I have an array in C#. How can I get rid of it?
I tried writing in this syntax but it still didnt work
List prompts = new List() {
“prompts go here”,
“and here”
}
New contributor
Emmanuel Ezechukwu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.