✅ 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?
No description
18 Replies
SpReeD
SpReeD8mo ago
Do you have ImplicitUsings on enable?
SleepWellPupper
SleepWellPupper8mo ago
What happens when you remove it?
SpReeD
SpReeD8mo ago
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.
SleepWellPupper
SleepWellPupper8mo ago
That's my thinking too.
daniswastaken
daniswastakenOP8mo ago
the code still running perfectly fine even if don't use the using statements how to disable it?
SpReeD
SpReeD8mo ago
<ImplicitUsings>disable</ImplicitUsings> in your *.csproj file
daniswastaken
daniswastakenOP8mo ago
oh wow, that is works bro that was easy thank you so much
daniswastaken
daniswastakenOP8mo ago
uh wait, does this line is actually being grayed out or is there something else disabled? im sorry im a newbie at programming
No description
becquerel
becquerel8mo ago
that probably means you're not using the args argument
daniswastaken
daniswastakenOP8mo ago
im just using the Console.WriteLine, is that normal?
becquerel
becquerel8mo ago
it's fine to not use it, to be clear vs code is just informing you in case it was a mistake
SpReeD
SpReeD8mo ago
The parameter isn't used, but, since this is a console app (my guess), it should have the args parameter to support cli arguments.
daniswastaken
daniswastakenOP8mo ago
okay, thank you man for helping appreciate it
becquerel
becquerel8mo ago
no prob
SleepWellPupper
SleepWellPupper8mo ago
Fyi, you can omit string[] args from the Main method signature. It's optional but the template contains it by default.
daniswastaken
daniswastakenOP8mo ago
okay, thank you for the information
SleepWellPupper
SleepWellPupper8mo ago
$close
MODiX
MODiX8mo ago
If you have no further questions, please use /close to mark the forum thread as answered
Want results from more Discord servers?
Add your server