Skip to content

CA1845: Adds unnecessary using statement when implicit usings exist #5652

@timheuer

Description

@timheuer

Version Used:
Microsoft Visual Studio Enterprise 2022 Int Preview (64-bit)
Version 17.0.0 Preview 5.0 [31808.319.d17.0]

Steps to Reproduce:

  1. Create a new console app in .NET6 - default implicit usings
  2. Add some code that triggers CA1845
  3. Executing the code fix

Expected Behavior:
using System; is not added

Actual Behavior:
It is added

Not sure if this is expected with the ImplicitUsings feature, but I just always hate when tools add something immediately grayed out.
implicit

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions