Did you know - Visual Studio can add Using directive automatically on paste? - D...
source link: https://dailydotnettips.com/did-you-know-visual-studio-can-add-using-directive-automatically-on-paste/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Did you know – Visual Studio can add Using directive automatically on paste?
In this post, let us learn how to add Using directive automatically while pasting a line of code in Visual Studio. Visual Studio always brings improvements with developer productivity. No matter how small some of the features are, they always help improve developer productivity. One such part is Add missing using directives on paste. This feature automatically adds a directive when you paste a line of code. However, it’s turned off by default. You need to turn it on before you see it in action.
Add Using directive automatically on Paste
To turn on this feature, navigate to Tools > Options > Text Editor > C#. and select Add missing using directives on paste. Refer to the below image.
Related Tip: Using or Using ?
Once this is enabled, in the code editor, whenever you paste some line, which has reference assembly and the directives are not included, it will be automatically included.
Check this out in action.
Hope this helps.
Read : Exploring Azure DevOps APIs
Best Tips & Tricks on Microsoft Technology Platform
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK