zoukankan      html  css  js  c++  java
  • Asp.Net MVC中递归死循环问题

    在写代码的时候,很欢乐地发现报错了。

    An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll

    具体图示如下:

    后来才发现自己写了一段多余的代码导致其不停循环往复陷入死循环。

    public class ConformanceListRepository
    {
        private readonly ConformanceListService _conformanceListService;
    
        public ConformanceListRepository(ConformanceListService conformanceListService)
        {
            _conformanceListService = conformanceListService;
        }
    }

    这里是在Repository中出了问题。

    所以解决思路是寻找可能出现死循环的地方,通常是像我上面这样,自己调用了自己(_conformanceListService调用ConformanceListRepository,然后循环往复)

  • 相关阅读:
    pymysql模块的使用
    MySQL创建用户、授权和备份
    多表查询
    单表查询
    mysql性能优化2
    mysql性能优化1
    穷人的思维
    thinkphp所有参数配置
    似水流年
    memecached常用命令
  • 原文地址:https://www.cnblogs.com/chenyangsocool/p/7492956.html
Copyright © 2011-2022 走看看