5

I have a solution with multiple projects. Since some point in time the unused usings is not fading anymore nor does the Remove and Sort Usings command work in ONE of the projects while still working as expected in the others.

Is there some settings or otherwise that can fix this?

Things I've tested so far:

  • Reset the checkbox in settings for "fade unsed usings",
  • Deleted the .vs folder

Two boilerplate classes created in different projects in same solution, opened side-by-side:

4
  • Do you use StyleCop? I found out that I had StyleCop.ruleset file and the rule IDE0005 was set to "None". I deleted both <Rule Id="IDE0005" Action="None" /> strings from it and unused usings are now grayed out. Commented Dec 11, 2020 at 18:38
  • The problem is long gone as stated in my answer - but I don't think I was (can't find any references in the source now anyways). I did never really find the root cause, thanks for chiming in with a hint though 👍 Commented Dec 12, 2020 at 1:12
  • This is repro'ing for my .NET Framework projects. Visual Studio v17.4.3. Commented Jan 5, 2023 at 13:40
  • 1
    I was able to fix the issue by right-clicking the offending csproj, Code Analysis > Configure active rule set > Active rules: and selecting Microsoft Managed Recommended Rules on the dropdown list. Commented Jan 5, 2023 at 14:57

2 Answers 2

2

"Tools" menu -> "Options" menu -> search for "using". Change your settings as needed.

enter image description here

Sign up to request clarification or add additional context in comments.

3 Comments

Unfortunately that does not solve my issue (it's what i've already tried) since that affects the whole environment, not just not one project of one solution, right?
Correct, these settings are for the Visual Studio, not just one Solution/Project.
well - as stated in the question, my issue is with one specific project and not visual studio in general.
0

This issue has solved it self since I've upgraded to SDK style project and installed a couple of VS updates (16.4.5 currently)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.