How do I automatically find out which assemblies I should reference and which namespaces I should be using?

If I know the name of the class I should be using, I know that I can see the namespace and assembly name on MSDN, but this is cumbersome.

Is it possible (in Visual Studio) to somehow automatically add references to all assemblies and all the required statements using

to be able to use all the classes and extension methods that I try to use in the source file .cs

?

+3


source to share


2 answers


For any namespaces you want to add to your using statements, right-click on the class you typed, then click Allow and select the namespace from the list (if the number corresponding to the class is greater than 1).



+1


source


Short answer No, there is no way to use VS to add a namespace without adding the assembly as a reference, but in case you added an assembly, the shortest way is to go to the class after typing it and press the little arrow (or Ctrl + Space) and select the space names you want to add



+1


source







All Articles