gpt4 book ai didi

c# - 如何让所有用户的 ASP.NET/Core 应用程序崩溃

转载 作者:行者123 更新时间:2023-12-04 17:49:20 25 4
gpt4 key购买 nike

我需要测试 ASP.NET/ASP.NET-Core 应用程序中严重错误的日志记录。
现在要对此进行测试,我需要产生一个使所有用户的应用程序崩溃的错误。

有点像

FATAL ERROR : Signal Received: SIGSEGV (11)

我当然可以轻松地在 http 请求上生成 YSOD,但是如何人为地生成使整个应用程序崩溃的错误,也就是说对于所有用户?

最佳答案

任何 stackoverflowing 错误都应该可以解决问题。
示例:

public class StackOverflower
{
private string m_MyText;

public string MyText
{
get { return MyText; }
set { this.m_MyText = value; }
}
}


class Program
{
[System.STAThread()]
static void Main(string[] args)
{
var foo = new StackOverflower();
System.Console.WriteLine(foo.MyText);
}
}

关于c# - 如何让所有用户的 ASP.NET/Core 应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46304066/

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