✅ Using statement still grayed out even if it in use [SOLVED]
So I had this problem with bot VSCode and VS where the using statement (using System;) is still grayed out even if it in use, is there any solution?
18 Replies
Do you have
ImplicitUsings
on enable
?What happens when you remove it?
It probably compiles, the gray out means it's unnecessary; almost for certain that
ImplicitUsings
are on, since it's enabled by default in the latest project template, along with Nullable
.That's my thinking too.
the code still running perfectly fine even if don't use the using statements
how to disable it?
<ImplicitUsings>disable</ImplicitUsings>
in your *.csproj
fileoh wow, that is works bro
that was easy
thank you so much
uh wait, does this line is actually being grayed out or is there something else disabled? im sorry im a newbie at programming
that probably means you're not using the args argument
im just using the Console.WriteLine, is that normal?
it's fine to not use it, to be clear
vs code is just informing you in case it was a mistake
The parameter isn't used, but, since this is a console app (my guess), it should have the
args
parameter to support cli arguments.okay, thank you man for helping
appreciate it
no prob
Fyi, you can omit
string[] args
from the Main
method signature.
It's optional but the template contains it by default.okay, thank you for the information
$close
If you have no further questions, please use /close to mark the forum thread as answered