How can I automatically link to links in Visual Studio C # like in Eclipse (java)

Is there a way to configure Visual Studio so that intellisence automatically inserts the β€œuse” of statements (reference to the class library), as in Eclipse (Java)?

Is this feature really useful as the visual studio only tells you that the link is missing, but no suggestions are displayed?

I am a new visual studio. Help would be greatly appreciated.

+4
source share
5 answers

Using the caret over the type declaration you just typed, press CTRL + ALT + F10, a context menu will appear prompting you to add the using statement. Also obvious (see JohnD Response) CTRL +. also works, and I just tried it, cool, every day we learn something new!

EDIT

oops! sorry it should be: SHIFT + ALT + F10

enter image description here

Of course, this depends on the availability of the appropriate dll assembly in the project.

enter image description here

+7
source

If you select an expression that is not allowed, and press CTRL + . (control period), it will display a context menu to add a using statement.

+6
source

CTRL +. some part will go to reproduce the functionality. Another alternative is to use extension applications, Resharper is very good for this, and you can add links to your project.

+1
source

There are some extensions that would do this. here is one of them:

Quick Add Reference Extension for Visual Studio 2010

0
source

UI

There is a built-in option for this function after Visual Studio 2019 version 16.1.

Enable this option in Tools> Options> Text Editor> C #> Intellisense.

Sorry for the Chinese interface.

0
source

Source: https://habr.com/ru/post/1434347/


All Articles