This is the code. I've tried rewriting it in a new program but it's the same problem as soon as I create a class the "using system" and the others appear in light blue as well as attributes.
Asked
Active
Viewed 427 times
2 Answers
1
It means you can remove them from the file. Visual Studio includes some using
directives automatically when you create a class, because they're so frequently used.
For instance,
- the
System
library includes types likeString
,Int32
,DateTime
, tons of exceptions likeIndexOutOfRangeException
,FormatException
, etc. - the
System.Collections.Generic
library includesList<T>
,Dictionary<TKey, TValue>
, etc, and nearly every program will use a collection of some sort. - the
System.Linq
library is self-explanatory; again, nearly every program will use LINQ.
But if you don't use anything in them, Visual Studio greys them out so you know they're unused.
If you don't need them, you can delete them.

Grant Winney
- 65,241
- 13
- 115
- 165
-
but i am using the attributes why are they grayed out – youness ouachao Jan 15 '19 at 09:48
-
thank you so much for your answer, this problem has been bugging for 2 days – youness ouachao Jan 15 '19 at 15:32
0
Using in light blue are not used in the file.
Example of use of class Task
in System.Threading.Tasks
:
using System.Threading.Tasks;
class Example
{
...
private void ExampleFunc()
{
// Whitout using
System.Threading.Tasks.Task.Delay(5000).Wait();
// OR
// With using
Task.Delay(5000).Wait();
}
...
}
You have to read the documentation to learn how to use class inside packages. And the most important for begining, what package is made for.

Shim-Sao
- 2,026
- 2
- 18
- 23
-
-
When you use a class or something else in an assembly, otherwise you can delete them – Shim-Sao Jan 15 '19 at 00:38