【问题标题】:How to install the latest version of NuGet.exe CLI in Ubuntu 18.04 WSL?如何在 Ubuntu 18.04 WSL 中安装最新版本的 NuGet.exe CLI?
【发布时间】:2019-09-09 14:44:41
【问题描述】:

我有 WSL 18.04 (Ubuntu),我想使用 NuGet.exe 使用以下代码将 Nuget 包安装到文件夹(不是 .csproj):

nuget install Test.Nuget.Version -OutputDirectory packages

在 WSL 中,我使用 sudo apt install nuget。但是,这只会在 Ubuntu 中安装旧的 nuget 版本 2.8.xxx。 =(

为了运行nuget install 命令,我必须使用安装在 Ubuntu 中的最新版 NuGet 版本(5.x.x)。

是否可以在 Ubuntu 中安装最新的 NuGet 版本? 如果是,我该怎么做?

【问题讨论】:

标签: linux ubuntu nuget windows-subsystem-for-linux


【解决方案1】:

通常您可以让 nuget 自行更新:

nuget.exe update -self

但是最近,因为我假设他们已经更新了最小 TLS 版本,所以可能会收到以下错误:

The authentication or decryption has failed.
  Error while sending TLS Alert (Fatal:InternalError): System.IO.IOException:

因此,您的 nuget 版本必须足够新才能自行升级。

所以你必须通过其他方式获得一个新的 nuget.exe:

curl https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -o nuget.exe

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-21
    • 1970-01-01
    • 2019-01-11
    • 1970-01-01
    • 2020-01-02
    • 2017-04-04
    相关资源
    最近更新 更多