CI无法构建.NET项目,失败并显示:“找不到系统上安装的有效ICU软件包..." [英] CI cannot build .NET project, fails with: "Couldn't find a valid ICU package installed on the system..."
问题描述
我正在努力让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码头工人镜像( 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.
现在,我尝试使用一个真正的旧版应用程序,该应用程序在从命令行运行命令时可以很好地构建,但是当詹金斯尝试运行 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屋!