Nikolai Samteladze Nikolai Samteladze - 5 months ago 58
C# Question

Automatically add NuGet dependencies and using statements in Visual Studio Code?

I am using Visual Studio Code to develop an ASP.NET 5 application on Mac. In order to use new classes (framework or third-party) in my

file, I need to

  1. Manually add a NuGet dependency in
    and then

  2. Manually add a
    statement to my

It seems that there should be a better way to import new functionality that doesn't involve searching for the right NuGet and the correct namespace. Any suggestions?


Well, once I got my IntelliSense issues figured out (Visual Studio Code on Mac), I don't have to type using statements anymore. OmniSharp-based IntelliSense is smart enough to suggest (Cmd + . on Mac) adding them for me:

enter image description here

I still have to add a NuGet dependency manually, but I think this is the default behavior in the full Visual Studio too and you need ReSharper to get smarter than that.

enter image description here