When adding a new class, it only creates it with namespace and without usings. I had no such problem before in VS19. How can i fix it?
I tried to reinstall vs
CodePudding user response:
As said, Try to add
new controller class
it would addusing
block, but fornew class
it won't, because, your class doesn't use any additional refereces which need to add initially, inVisual studio
lastest release for adding new class it won't add anyusing block
since it doesn't has any reference to add.
Note: If you would just try it before dotnet core 3.1
you would see that it would add using
block. as below:
Since
dotnet 5 and 6
compiler automatically adds a set ofusing directives
based on the project type. You canSo hope you get the difference already. It’s not an issue, it’s a new features in
latest dotnet release
to redeem repetitive using directive monotonously.