VS.NET Tip – Easily Resolve Unknown or Ambiguous Namespace

This is one of those little things that I use in Visual Studio.NET a lot and has made my life much easier when resolving unknown or ambiguous namespaces in VS. It’s funny, because I’ve used this so much that I thought everyone knew about it until I showed someone at work who had never used it before. Then I asked another person and they had never used it before. I felt like I was in the twilight zone…no matter…here it is.

How:

  1. Right click on your unknown type
  2. Select Resolve
  3. Select the correct Namespace

Example:
1.  We have an unknown type of XmlDocument
unknownnamespace

 

 

2. Right-click, select “Resolve”, then “using System.Xml;”

 
 
 
 
 
And vuala “using System.Xml;” is added to your using statements at the top of your class! No more searching for the correct namespace. Just a 2-click operation now…hope that helps you out.

- Matti