【问题标题】:Cant find package manager console in visual studio for mac在 Visual Studio for Mac 中找不到包管理器控制台
【发布时间】:2017-05-20 13:39:58
【问题描述】:

我正在使用 Visual Studio for mac。我需要安装一些包,但我找不到包管理器控制台。

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

【问题讨论】:

    标签: visual-studio-mac


    【解决方案1】:

    警告:

    一位评论者报告此扩展使 VS Community 2019 for Mac 版本 8.5(Build 3183)崩溃。我还没有升级到它,所以我不能说这个。任何有信息/修复/替代方法的人,请在 cmets 中加入。

    好的:

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

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

    【讨论】:

    • 太糟糕了,MS 没有像 VS 2019 Windows 版本那样在官方版本中包含这个
    • 扩展使整个 VS 崩溃(VS Community 2019 for Mac 版本 8.5 (Build 3183))
    • 啊,我还在 8.4.8 上,所以我不能说这个。我会添加一个警告。
    【解决方案2】:

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

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

    由于没有跨平台 PowerShell,Xamarin Studio 缺少包管理器控制台。它可能有一天会出现在 Visual Studio for Mac 中。我们会看到的。

    【讨论】:

    • 所以无法像在 Windows 中那样查看更新和安装的包?
    • @MattG 设计理念不同。您应该转到解决方案资源管理器并检查每个包引用的更新。
    【解决方案3】:

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

    提供的链接摘录如下:

    ma​​cOS/Linux

    行为可能因操作系统分布而略有不同。

    1. 安装Mono 4.4.2 or later

    2. 在 shell 提示符下执行以下命令:

      # 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. 通过将以下脚本添加到您的操作系统的相应文件(通常为~/.bash_aliases or ~/.bash_profile)来创建别名:

      # Create as alias for nuget
      alias nuget="mono /usr/local/bin/nuget.exe" 
      
    4. 重新加载外壳。通过不带参数输入nuget 来测试安装。应显示 NuGet CLI 帮助。

    【讨论】:

      【解决方案4】:

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

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

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

      【讨论】:

      • 欢迎来到 Stackoverflow。建议您编辑解释此解决方案如何工作的答案,而不是发布外部链接。检查元帖子以获取清单以提供更多有用的答案meta.stackexchange.com/questions/7656/…
      猜你喜欢
      • 2011-07-10
      • 2013-01-03
      • 2016-09-10
      • 1970-01-01
      • 2018-04-29
      • 2022-01-26
      • 1970-01-01
      • 2022-06-29
      • 2021-08-21
      相关资源
      最近更新 更多