在 visual studio 中找不到 mac 的包管理器控制台

Cant find package manager console in visual studio for mac

我正在为 mac 使用 Visual studio。我需要安装一些软件包,但找不到相应的软件包管理器控制台。

Visual studio 版本:预览版 1 (7.0 build 347)

类似于Xamarin Studio,你必须使用它的对话框,

https://developer.xamarin.com/guides/cross-platform/xamarin-studio/nuget_walkthrough/

由于没有跨平台的 PowerShell,Xamarin Studio 缺少程序包管理器控制台。 Mac 的 Visual Studio 的某一天可能会到来。我们拭目以待。

您可以按照 NuGet CLI 参考进行安装 https://docs.microsoft.com/en-us/nuget/tools/nuget-exe-cli-reference

link 提供的摘录如下:

macOS/Linux

Behaviors may vary slightly by OS distribution.

  1. Install Mono 4.4.2 or later.

  2. Execute the following commands at a shell prompt:

    # Download the latest stable `nuget.exe` to `/usr/local/bin`
    sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
    # Give the file permissions to execute
    sudo chmod 755 /usr/local/bin/nuget.exe 
    
  3. Create an alias by adding the following script to the appropriate file for your OS (typically ~/.bash_aliases or ~/.bash_profile):

    # Create as alias for nuget
    alias nuget="mono /usr/local/bin/nuget.exe" 
    
  4. Reload the shell. Test the installation by entering nuget with no parameters. NuGet CLI help should display.

警告:

一位评论者报告此扩展在 Mac 版本 8.5(内部版本 3183)的 VS Community 2019 中崩溃。我还没有升级到它,所以我不能说这个。任何有 information/fix/alternate 方法的人,请在评论中插话。

确定:

至少在 Visual Studio Community 8.4.8 build 2 中,您可以在 Visual Studio-->Extensions 下找到它,使用搜索词 "nuget":

我花了很长时间才找到这个我希望它能帮助其他人更快地找到它!

我为 mac 用户找到了一个很好的参考:

https://github.com/mrward/monodevelop-nuget-extensions

感谢您的参考,它对我有用。