Console.Writeline throwing error CS0234 in one class but the program.cs in the same project doesn't.
Hello, I have a console app project where there is the default program.cs class where console.writeline works, but then I have a separate class within that same project where it doesn't work. It says WriteLine doesn't exist in the namespace.. are you missing a reference? Idk if I've ever had this happen especially when it works in another class within that project!
Adding in "using system;" just has it greyed out as if it's already using it.
28 Replies
Show your code
And where is the error?
On every Console.WriteLine

What happens if you fully qualify the call
Ie, System.Console.WriteLine
using system;
well that works...
if I do that it's just greyed out and doesn't fix it
Reread the op where that was already tried 🙂
but why would it even need that? lol doens't make sense
Oh, I'm an idiot, look at your namespace
does the .Console break it?
Yep
ok I thought that could've been it, my instructor said dot console when creating it though so probably just a flub, thanks though!
No problem. Make sure to mark it as $closed if that's all
$close
If you have no further questions, please use /close to mark the forum thread as answered
$close
If you have no further questions, please use /close to mark the forum thread as answered
$ is just a tag, / invokes commands
$close
If you have no further questions, please use /close to mark the forum thread as answered
Use the command, not the tag
I tried it says the application did not respond
or the other says I dont have permission
Well, that's annoying
I'd ping @Patrick, but I feel like he might be unable to kick accord right now
Oh, oops, silly me, I pinged @Patrick anyways
Hello
I cant close this
Ok just ignore it
ok