gpt4 book ai didi

c# - InternalSubStringWithChecks 异常

转载 作者:行者123 更新时间:2023-11-30 12:36:28 27 4
gpt4 key购买 nike

我们在应用程序的健康监控中遇到了这个 InternalSubStringWithChecks 异常。

此异常类似于 Padding is invalid并且无法删除正在记录的异常,我们收到一封通知电子邮件,但最终用户不知道实际发生了错误。虽然我们不希望我们的事件日志充满这些垃圾!

堆栈跟踪是:

Event message: System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

我找不到任何有用的信息来说明导致此问题的原因以及如何通过 Google 修复它。还有其他人遇到/解决过这个问题吗?

最佳答案

您正在使用不正确的参数调用 Substring() 方法。例如:

string a = "test";

a.Substring(0,100)

会抛出异常。

关于c# - InternalSubStringWithChecks 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3228950/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com