System.ArgumentNullException in visual studio on MAC | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

System.ArgumentNullException in visual studio on MAC

Can you help me plz... my code: public static void Main() { Console.WriteLine("inter char"); char exit = Convert.ToChar(Console.ReadLine()); } when I run it on my visual studio in Windows, it works. but if I copy this and run in visual studio on my Mac, when it compiling it says: System.ArgumentNullException has been thrown Value cannot be null parameter name: value what I do wrong?

3rd Sep 2018, 1:40 PM
Anton K
Anton K - avatar
8 Answers
+ 2
try putting "string[] args" back into the parameters for Main()
3rd Sep 2018, 1:54 PM
hinanawi
hinanawi - avatar
+ 2
Anton K you put an "@" symbol, then a list of names will show up, select the person you want to mention
3rd Sep 2018, 2:11 PM
hinanawi
hinanawi - avatar
+ 2
Anton K also, on mac, try having it be a string instead of a character, because characters can't be null so the error has something to do with that probably
3rd Sep 2018, 2:12 PM
hinanawi
hinanawi - avatar
+ 1
Anton K why did you send that code?
3rd Sep 2018, 2:01 PM
hinanawi
hinanawi - avatar
+ 1
Anton K really? the code works fine on SL for me, just remember that all inputs have to be entered at the start. as for it working on a mac, i can't test that as i don't own a mac
3rd Sep 2018, 2:06 PM
hinanawi
hinanawi - avatar
0
it is the full code. but this string give me an error char Continue = Convert.ToChar(Console.ReadLine());
3rd Sep 2018, 2:04 PM
Anton K
Anton K - avatar
0
yeah ( it works on SL and Win, but on MAC - System.ArgumentNullException PS how can I mention you, when writing comment, I can't understand?)
3rd Sep 2018, 2:10 PM
Anton K
Anton K - avatar