By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,422 Members | 1,282 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,422 IT Pros & Developers. It's quick & easy.

Let VisualCShapr automatically insert necessary "using" statements ?

P: n/a
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"

May 24 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
* 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
May 24 '07 #2

P: n/a
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" <wm******@hotmail.comwrote in message
news:46***********************@newsspool3.arcor-online.net...
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"

May 24 '07 #3

P: n/a
Wolfgang Meister <wm******@hotmail.comwrote:
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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
May 24 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.