无法将.NET 6代码部署到K8S中,POD状态为CrashloopBackoff注意:这是一个工作代码。

发布于 2025-02-12 02:31:38 字数 505 浏览 1 评论 0原文

相同的代码在Visual Studio 2022中运行良好...但是当我在K8S POD中部署时,它正在崩溃。.NET5。 ..

在POD日志中获取以下错误,

未经处理的异常。 System.io.FileLoadeXception:无法加载文件或汇编'System.Runtime,版本= 6.0.0.0,culture =中性,publicKeyToken = B03F5F7F11D50A3A'。位置的组件的清单定义与汇编引用不符。 (0x80131040) 文件名:'System.Runtime,版本= 6.0.0.0,Culture = Neutral,publicKeyToken = B03F5F7F11D50A3A'

安装.NET SDK并运行时间我在Docker文件中有Beow Line,

run DNF dnf install dnf install dnf install dotnet dotnet-sdk-6.0。 106 -y

运行DNF安装dotnet -runtime -6.0.6 -y

Same code is working fine in Visual Studio 2022... But When I deploy in K8s pod it's crashing.. the same code was working still yesterday with .Net5.. once the dev team migrated the code into .Net 6 now it's not working..

Getting the below error in pod logs,

Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
File name: 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

To install the .net SDK and run time I have the beow line in my docker file,

RUN dnf install dotnet-sdk-6.0.106 -y

RUN dnf install dotnet-runtime-6.0.6 -y

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沙沙粒小 2025-02-19 02:31:38

感谢您的时间和指导,现在解决此问题(上周本身)。

嗨,马丁,
<分析> 6.0< Anallyslevel>

Hi Martin thanks for your time and guidance, this issue is resolved now (last week itself)..

By adding this into the .csproj ProprtyGroup
< AnalysisLeve > 6.0 < AnalysisLevel >

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文