3

Did you know - Visual Studio can add Using directive automatically on paste? - D...

 3 years ago
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.
neoserver,ios ssh client

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.

selection missing directives option

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.

2021-05-10_20-01-29.gif?resize=558%2C432&ssl=1

Hope this helps.

Read : Exploring Azure DevOps APIs

DON'T MISS OUT!
Subscribe To Newsletter For your Daily Development Tips and Tricks  

 Best Tips & Tricks on Microsoft Technology Platform 

We promise not to spam you. You can unsubscribe at any time.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK