Visual Studio 社区 2017 "add package" 按 Ctrl+点时
Visual Studio Community 2017 "add package" when pressing Ctrl+Dot
在 Visual Studio Community 2015 Update 3 中,当你有一个项目中不存在的类型时,VS 将搜索包源并给出 "add package xxx" 建议,如下所示:
但是在VS2017社区中,这个功能没有了。有没有打开它的选项?或者它被完全删除了?为什么?
默认关闭,需要在VS2017中开启
来自here:
Add using/Imports for types in reference assemblies/NuGet packages –
if you type an unrecognized type, we will search for it in your
reference assemblies and on NuGet.org and offer a quick fix to add the
using/Imports. This feature is off by default; to enable it go to
Tools > Options > Text Editor > [C#/Basic] > Advanced > Suggest usings
for types in reference assemblies and Suggest usings for types in
NuGet packages. Enabling the latter option will download 10 MB of a
NuGet index on your machine and it will take several seconds to
complete (this will not affect your workflow in VS, but it does means
you cannot immediately use the feature once enabling it).
在 Visual Studio Community 2015 Update 3 中,当你有一个项目中不存在的类型时,VS 将搜索包源并给出 "add package xxx" 建议,如下所示:
但是在VS2017社区中,这个功能没有了。有没有打开它的选项?或者它被完全删除了?为什么?
默认关闭,需要在VS2017中开启
来自here:
Add using/Imports for types in reference assemblies/NuGet packages – if you type an unrecognized type, we will search for it in your reference assemblies and on NuGet.org and offer a quick fix to add the using/Imports. This feature is off by default; to enable it go to Tools > Options > Text Editor > [C#/Basic] > Advanced > Suggest usings for types in reference assemblies and Suggest usings for types in NuGet packages. Enabling the latter option will download 10 MB of a NuGet index on your machine and it will take several seconds to complete (this will not affect your workflow in VS, but it does means you cannot immediately use the feature once enabling it).