CI 无法构建 .NET 项目,失败并显示:“找不到安装在系统上的有效 ICU 包..."; [英] CI cannot build .NET project, fails with: "Couldn't find a valid ICU package installed on the system..."

查看:37
本文介绍了CI 无法构建 .NET 项目,失败并显示:“找不到安装在系统上的有效 ICU 包...";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力让 Jenkins 构建我们的旧版 .NET 2.1 应用程序,作为简化我们的 kubernetes 部署的一部分

I am working on having Jenkins build our legacy .NET 2.1 applications as part of streamlining our kubernetes deployments

因此我基于 jenkins/jnlp-slave:latest-jdk11 docker image (https://github.com/jenkinsci/docker-jnlp-slave),后者又基于 Debian 9,使用官方 .NET Core 进行扩展(从 https://dotnet.microsoft.com/download/dotnet-core/2.1 ,Debian 更新不与我们的防火墙配合良好),对于琐碎的项目,这也很有效.

Therefore I have created a custom Jenkins agent based on the jenkins/jnlp-slave:latest-jdk11 docker image (https://github.com/jenkinsci/docker-jnlp-slave) which in turn is Debian 9 based, extended with the official .NET Core (unpacked the ZIP from https://dotnet.microsoft.com/download/dotnet-core/2.1 , Debian updates does not work well with our firewall), and for trivial projects this has worked well.

现在我尝试使用真正的遗留应用程序,它在从命令行运行命令时构建得很好,但是当 Jenkins 尝试运行 dotnet restore -v n 时,构建立即失败:

Now I try with a real legacy application which builds nicely when running the commands from the command line, but when Jenkins try to run dotnet restore -v n the build immediately fails with:

+ dotnet restore -v n
11:11:29  FailFast:
11:11:29  Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.
11:11:29  
11:11:29     at System.Environment.FailFast(System.String)
11:11:29     at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()
11:11:29     at System.Globalization.GlobalizationMode..cctor()
11:11:29     at System.Globalization.CultureData.CreateCultureWithInvariantData()
11:11:29     at System.Globalization.CultureData.get_Invariant()
11:11:29     at System.Globalization.CultureInfo..cctor()
11:11:29     at System.StringComparer..cctor()
11:11:29     at System.AppDomain.InitializeCompatibilityFlags()
11:11:29     at System.AppDomain.Setup(System.Object)
11:11:29  Aborted (core dumped)

对 .NET 不是很熟悉,我可能在设置环境时错过了某个步骤.应用程序需要在da-DK"语言环境中运行.

Not being very experienced with .NET, I have probably missed a step somewhere when setting up the environment. The application needs to run in the "da-DK" locale.

我知道缺少某些部分.这应该如何解决?我对特定于项目的快速解决方案和特定于代理的长期解决方案都感兴趣.

I understand that some part is missing. How should this fixed? I am interested in both project-specific quick solutions and long-term agent-specific solutions.

推荐答案

定位后 https://docs.microsoft.com/da-dk/dotnet/core/tools/dotnet-install-script 在下载页面上,并看到需要的依赖项"链接组合通过安装脚本的输出,我发现根本原因是缺少库依赖项,解决方法是将它们安装在 Dockerfile 中.

After locating https://docs.microsoft.com/da-dk/dotnet/core/tools/dotnet-install-script on the download page, and seeing the "needed dependencies" link combined with the output from the install script, I found that the underlying reason was missing library dependencies, and the fix was to install them in the Dockerfile.

# Needed dependencies...
RUN apt install -y libunwind8 libicu57

这篇关于CI 无法构建 .NET 项目,失败并显示:“找不到安装在系统上的有效 ICU 包...";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆