【问题标题】:.net 5 dotnet build hangs on restore on Linux CentOS/Redhat.net 5 dotnet 构建在 Linux CentOS/Redhat 上恢复时挂起
【发布时间】:2021-06-09 00:27:59
【问题描述】:

dotnet build 在机器上安装 .net 5 sdk 后挂起恢复。当我取消它显示以下内容:

MSBUILD : error MSB4166: Child node "3" exited prematurely. Shutting down. Diagnostic information may be found in files in "/tmp/" and will be named MSBuild_*.failure.txt. This location can be changed by setting the MSBUILDDEBUGPATH environment variable to a different directory.
MSBUILD : error MSB4166: Child node "4" exited prematurely. Shutting down. Diagnostic information may be found in files in "/tmp/" and will be named MSBuild_*.failure.txt. This location can be changed by setting the MSBUILDDEBUGPATH environment variable to a different directory.
MSBUILD : error MSB4166: Child node "2" exited prematurely. Shutting down. Diagnostic information may be found in files in "/tmp/" and will be named MSBuild_*.failure.txt. This location can be changed by setting the MSBUILDDEBUGPATH environment variable to a different directory.
/usr/share/dotnet/sdk/5.0.201/NuGet.targets(131,5): error : Restore canceled! [/srv/project/project.csproj]

nuget 配置设置为使用~/.nuget/NuGet/NuGet.Config 中的代理

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
  <add key="dependencyVersion" value="Highest" />
  <add key="http_proxy" value="http://proxy.url.com:8080" />
</config>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
</configuration>

我不确定发生了什么变化,据我所知,代理 URL 没有任何变化。这以前适用于 .net core 3.1,但在安装新的 sdk 后不再适用。

有什么改变需要我解决吗?我在 .net 5 更改日志中没有看到任何关于此的内容。至少从我搜索任何东西nuget.

【问题讨论】:

    标签: .net nuget .net-5 dotnet-build


    【解决方案1】:

    我不得不完全重新安装 .net5。以前的安装挂起,因为它在代理后面。并且由于某种原因,新的 sdk 没有确认代理设置,或者安装在该过程中的某个位置被挂起。

    这是一个 redhat 发行版,所以 yum list installed | grep "dotnet" 并用它来删除所有内容。我删除了 .nuget 包,并使用 Microsoft 提供的 dotnet-install.sh 手动安装:./dotnet-install.sh -c 5.0。我不得不经历更多的麻烦,因为它是手动安装并且默认为~/.dotnet作为安装目录,但是在路径中获取可执行文件并在服务中分配正确的环境变量之后,我能够再次将其编译到服务器上并运行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-28
      相关资源
      最近更新 更多