[英].netcore `GLIBC_2.14' not found error on linux (RHEL)
On windows 10, I created a .netCore (3.1.200) console application called helloWorld.在 Windows 10 上,我创建了一个名为 helloWorld 的 .netCore (3.1.200) 控制台应用程序。 Published it using the command:
使用以下命令发布它:
dotnet publish -r linux-x64 --self-contained true
Copied over the publish folder to my linux machine (RHELS 6.10).将发布文件夹复制到我的 linux 机器(RHELS 6.10)。 Applied the executable permission
chmod +x helloWorld
应用了可执行权限
chmod +x helloWorld
When I run the command, helloWorld
, I am getting this error:当我运行命令
helloWorld
时,出现此错误:
helloWorld: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by helloWorld)
How can I resolve that?我该如何解决?
Here's the answer for anyone else having the same issue.这是其他有同样问题的人的答案。
publish command : dotnet publish -r rhel.6-x64 --self-contained true
发布命令:
dotnet publish -r rhel.6-x64 --self-contained true
When you run it on RHEL you will get another error saying "ICU is missing".当您在 RHEL 上运行它时,您会收到另一个错误消息,提示“ICU 丢失”。
To Resolve that : Add a new file in your project called runtimeconfig.template.json解决方法:在项目中添加一个名为runtimeconfig.template.json的新文件
Add this to the file:将此添加到文件中:
{
"configProperties": {
"System.Globalization.Invariant": true
}
}
Now republish and re-run.现在重新发布并重新运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.