Search code examples
c#namespacesvisual-studio-2013using-directives

How to find using directives


I wold Like To Know How To Easily Find using directives eg.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using System.Threading;

I am Learning how to use VS2013 & c#,so i Google a lot of things.Some times i get a chard of code and VS says:

The type or namespace name 'somenamespace' could not be found (are you missing a using directive or an assembly reference?) 

Then i Google a lot to find the correct using namespace ,time wasted. is there a library i can search for it, or a video that would show me how to find these things?


Solution

  • Both Visual Studio 2010 and 2012 suggest you suitable namespaces even without any additional tools or libraries.

    Just point to class name that needs additional using directive and you will see small rectangle below which will bring out a popup. On the picture you can see both ReSharper and VS popups.

    You can also check the class name in the MSDN. It always show you the namespace for current class like:

    Namespace: System.IO

    Assembly: mscorlib (in mscorlib.dll)

    VS popup sample