When I type a method for which the namespace has not been imported, I get a red wavy underline (aka squiggly red line) that indicates there is an error. Using Visual Studio 2012, I can right click this red line and quickly select the desired namespace using Resolve > using System.Text.RegularExpressions
from the right-click context menu. I also have the option to fully qualify my method with the complete namespace.
Using Visual Studio 2012:
In Visual Studio 2015 preview, this option is missing from my right-click context menu. Does anyone know how to enable this -or- quickly choose the namespace I want?
Place your cursor in the namespace name. Press Ctrl+. to trigger the Quick Actions and Refactorings menu.
You can change the default namespace: -> Project -> XXX Properties... Instead of Find/Replace, you can also right click the namespace in code and Refactor->Rename.
This menu has been changed and a new feature was added. The original menu item has been replaced by "Quick Actions...", which brings up its own sub-menu where I can find the things I'm looking for such as importing namespaces and refactoring options:
@dotnetstep is absolutely correct.
For an even faster resolution process:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With