using System.Text; // If unused using directive turn gray.
using System.Threading.Tasks; // If unused using directive turn gray.
using System.Windows;
The unused using directive turn gray.
What kind of settings should I set up in the visual studio?
For detect the unused using directive immediately
I tried => go to Tool-Setting-Text editor, then check to using set
But I failed
I asking "How to fade about unused using"
CodePudding user response:
You could remove all at the same time and organize things by right click in the editor and press -> "Remove and Sort usings (CTRL R, CTRL G) (default I think). This works for the current file.
If you want to get a warning you could create a file in your solution named .editorconfig
[*.{cs,vb}]
IDE0005: Remove unnecessary imports dotnet_diagnostic.IDE0005.severity = warning"
Then set analysis setting to "Entire solution" like in the image below. Hope it helps.