Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the shortcut to auto import library in visual studio 2010, 2012 (if any- like Alt+Enter in Netbeans)?

I don't know where is the short-cut button to auto generate namespace import in C# winform/ window store... application, like the Alt+Enter shortcut in NetBean IDE. I and some of my friends have programmed in visual studio for several years but when we need to import library, we have to move the cursor after the Class code and click to show namespace like this:

missing reference error

Thank you for your help :)

like image 253
Hung Phan Dang Avatar asked Nov 05 '12 09:11

Hung Phan Dang


People also ask

What is the shortcut for importing the methods?

Note: We can import a single missing import using Alt + Enter which shown in the pop-up. To optimize imports (to remove unused imports ) use Ctrl + Alt + O. If for some reason auto-import is not enabled you can go to settings by typing shortcut: Ctrl + Alt + S.

How do you import things into VS code?

Import to topCtrl+Shift+A a file in explorer → Ctrl+I in your editor tab. or Alt+D a file in explorer to automatically import in editor tab.


1 Answers

Try CTRL+. to open up the quick fix which will give you different options to fix such an error, including adding usings for the correct namespace—if VS finds a valid type in the references.

like image 160
poke Avatar answered Sep 17 '22 23:09

poke