Let VisualCShapr automatically insert necessary "using" statements ?

  • Thread starter Thread starter Wolfgang Meister
  • Start date Start date
W

Wolfgang Meister

Is there a way to let VisualStudio insert automatically (after pressing e.g. F7)
missing "Using" statements at the top ?

Or is there a menu which suggests inserts for using directives ?

How can I otherwise find out which "using" I have to add for e.g. "StreamWriter"
or "File"
 
* Wolfgang Meister wrote, On 24-5-2007 22:01:
Is there a way to let VisualStudio insert automatically (after pressing e.g. F7)
missing "Using" statements at the top ?

Or is there a menu which suggests inserts for using directives ?

How can I otherwise find out which "using" I have to add for e.g. "StreamWriter"
or "File"

Type the word StreamWriter, then hit ctrl+. and select the option youw
ant to use.

Jesse
 
Go to the statement that has the unresolved reference (just double click on
the error message). Then, right click on that statement to get a pop-up
menu. One of the items in the menu will be "resolve". That will give you
the option to resolve with the correct "using" statement. It will insert
the "using" statement for you.
 
Wolfgang Meister said:
Is there a way to let VisualStudio insert automatically (after pressing e.g. F7)
missing "Using" statements at the top ?

Or is there a menu which suggests inserts for using directives ?

With Visual Studio 2005, when you put the name of a type, a little red
bar appears underneath the last letter. Pressing ctrl and period
together will give you the option of adding a using statement.
How can I otherwise find out which "using" I have to add for e.g. "StreamWriter"
or "File"

I usually keep MSDN up, in the index.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top