【解決方法】ライブプロジェクトでこのエラーを解決する方法プログラムを安全に実行し続けるにはスタックが不十分ですか?


Insufficient stack to continue executing the program safely. This can happen from having too many functions on the call stack or function on the stack using too much stack space. 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.InsufficientExecutionStackException: Insufficient stack to continue executing the program safely. This can happen from having too many functions on the call stack or function on the stack using too much stack space.

Source Error: 


 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 



[InsufficientExecutionStackException: Insufficient stack to continue executing the program safely. This can happen from having too many functions on the call stack or function on the stack using too much stack space.]
   System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack() +0
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +17
   System.Web.UI.Control.FindControl(String id) +12
   Airport_SelectVehicle1.GridView1_RowDataBound(Object sender, GridViewRowEventArgs e) +262
   System.Web.UI.WebControls.GridView.OnRowDataBound(GridViewRowEventArgs e) +111
   System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource) +181
   System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +3724
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +67
   System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +14
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +123
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +33
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +138
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +30
   System.Web.UI.WebControls.GridView.DataBind() +4
   Airport_SelectVehicle1.load_items() +97285
   Airport_SelectVehicle1.Page_Load(Object sender, EventArgs e) +2699
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
   System.Web.UI.Control.OnLoad(EventArgs e) +92
   System.Web.UI.Control.LoadRecursive() +54
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772

解決策 1

例外テキストは明確に説明しています スタックオーバーフロー 状態。

きちんと外に出ていないために起こることがあります 再帰 また 相互再帰:
再帰 – フリー百科事典ウィキペディア[^]、
再帰 (コンピューター サイエンス) – ウィキペディア、フリー百科事典[^]、
相互再帰 – ウィキペディア、フリー百科事典[^].

これは、この例外につながる最も典型的なケースです。 問題の根本原因は通常、デバッガーを使用してごくわずかな反復で見つけることができます。 非常に一般的なテクニックのアイデアを次に示します。どのメソッドを「無限に」呼び出すことができるかを仮定し、その最初のステートメントにブレークポイントを設定します。 このブレーク ポイントで停止するまでコードを実行し、デバッグ ウィンドウの[コール スタック]を確認します。 スタックを参照すると、呼び出し元が表示されます。 次回はどこから来るのかを確認するために、何度も何度も繰り返します。 このようにして、検索をすばやく絞り込み、最終的に目的を見つけることができます。

-SA

コメント

タイトルとURLをコピーしました