Adding and Resolving Namespaces using Shortcut key in Visual Studio

This is one of the frequent requirement in visual studio either adding new namespaces corresponding to a class or resolving the namespaces. If you are adding a new class in your code then you may need to add the correspondence namespaces. To do it, you may either manually type the Using Namespace or you just right click on the class name and select Resolve > Namespace. But using “Ctrl+.” you can automatically add the namespace in your code. Lets consider you want to add DataTable in your code, so for that you right click on that class and select resolve to resolve the namespace. 1

Using “Ctrl+.” you can also automatically add the using statement as shown in below

2

Fig : Add namespace using Shortcut key

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.

One Comment to “Adding and Resolving Namespaces using Shortcut key in Visual Studio”

Comments are closed.