You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

C# Visual Studio窗体设计器出现System.StackOverflowException错误求助

C# WinForm Designer.cs触发StackOverflowException异常

我在Visual Studio中开发C#窗体程序时,Designer.cs文件内的以下代码抛出了System.StackOverflowException异常:

this.ClientSize = new System.Drawing.Size(409, 528); // 触发System.StackOverflowException错误

此前程序运行一切正常,写完这段代码后问题才出现,但我认为这段代码和异常完全无关,希望得到解决方案:

operation = '÷';
if (operand1 == "")
{
    operand1 = input;
    input = string.Empty;
}
else
{
    operand1 = calculate(operand1,input,operation);
    input = string.Empty;
}

(错误截图显示异常触发点为上述Designer.cs中的ClientSize赋值语句)

内容的提问来源于stack exchange,提问作者Raifa

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.08 17:01:23