在 System.Private.CoreLib 中查找资源“Arg_NullReferenceException”时遇到无限递归

Encountered infinite recursion while looking up resource 'Arg_NullReferenceException' in System.Private.CoreLib

提问人:Linus 提问时间:11/3/2023 最后编辑:Linus 更新时间:11/8/2023 访问量:57

问:

我的程序是在 .Net 7 (VS 2022) 中开发的,并在非英语 Windows 10 (x64) 上运行。大多数时候,我的程序工作正常。但是,有时会抛出以下错误(在事件查看器中),然后它将显示一个对话框,我的程序退出。

我该如何解决这个问题?似乎是与.Net有关的问题...

谢谢。

Application: XXX.EXE
CoreCLR Version: 7.0.1323.51816
.NET Version: 7.0.13

Description: The application requested process termination through
System.Environment.FailFast.

Message: Encountered infinite recursion while looking up 
resource 'Arg_NullReferenceException' in System.Private.CoreLib.

Verify the installation of .NET is complete and does not need
repairing, and that the state of the process has not become corrupted.

Stack:
   at System.Environment.FailFast(System.String)
   at System.SR.InternalGetResourceString(System.String)
   at System.SR.GetResourceString(System.String)
   at System.NullReferenceException..ctor()
   at System.Globalization.CultureInfo.get_CurrentUICulture()
   at System.Resources.ResourceManager.GetString(System.String, System.Globalization.CultureInfo)
   at System.SR.InternalGetResourceString(System.String)
   at System.SR.GetResourceString(System.String)
   at System.NullReferenceException..ctor()
   at xxx (related to my code)
C# Windows NullReferenceException net-7.0

评论


答: 暂无答案