madskristensen / AddAnyFile

A Visual Studio extension
Apache License 2.0
262 stars 119 forks source link

Support for .NET 6 implicit usings #124

Open JonHodgins opened 2 years ago

JonHodgins commented 2 years ago

Description

Using Add New File for C# classes and interfaces will add usings from the System namespaces even when implicit usings is enabled. I believe these can be overridden by adding custom templates, but this extension should ideally be able to detect if implicit usings are enabled and then omit them.

Steps to reproduce

  1. Create a new project from a .NET6 template, or enable implicit usings in an existing .csproj
  2. Use Add New File to add a C# class or interface

Expected behavior:

The new class/interface contains no using statements.

Actual behavior:

The new class/interface contains using statements for System, System.Collections.Generic, System.Linq, System.Text, and System.Threading.Tasks.