C# 奇怪的错误';System.ExecutionEngineeException';发生在mscorlib.dll中

C# 奇怪的错误';System.ExecutionEngineeException';发生在mscorlib.dll中,c#,exception,C#,Exception,以下是我得到的错误: System.ExecutionEngineException was unhandled HResult=-2146233082 Message=Exception of type 'System.ExecutionEngineException' was thrown. InnerException: 代码更新: 这是我的密码 void WriteGraph(int[] vData) { string tempWrite = "&q

以下是我得到的错误:

System.ExecutionEngineException was unhandled
HResult=-2146233082
Message=Exception of type 'System.ExecutionEngineException' was thrown.
InnerException: 
代码更新: 这是我的密码

void WriteGraph(int[] vData)
    {
        string tempWrite = "";
        try
        {
            for (int y = 0; y < vData.Length;)
            {
                for (int i = 0; i < 20; i++)
                {
                    tempWrite = tempWrite + vData[i] + ",";
                    y++;
                }
                File.AppendAllText(name2, tempWrite);
            }
         
           File.AppendAllText(name2, Environment.NewLine);
        }
        catch ( Exception e)
        {
            AppendTextBox(e.Message.ToString());
        }
    }

同样的事情也发生在我身上,但它只在纱线重建完成时抛出这个异常(前端是React)。我正在使用IIS Express在本地运行。我想知道它是否不喜欢应用程序运行时文件正在更改

这似乎解决了这个问题:


转到工具、选项、项目和解决方案、Web项目;并选中“将64位版本的IIS Express用于网站和项目”。

发生此问题的原因是,在抛出ExecutionEngineeException之前出现了一些故障。 面对这个问题(在WPF应用程序的文本框中键入日语字符),我解决了在VS的异常设置中激活公共语言运行时异常的问题 检查每个运行时异常的值(在get crash之前),我在前面的方法中的一个变量中发现了一个空值,但是崩溃在很多秒之后被抛出。
您可以在这里找到一个深刻的解释:

在我的例子中,这发生在ServiceFabric启动之前,它还没有开始运行。异常显示在事件查看器中,而不是VS中。

尝试调试并查看变量-应该会给您一个线索。好的,所以我不确定要查看什么。VData中包含数据。它的大小是1024,所以我不想把所有的点都看一遍。好吧,看起来它在I=305时死了。好吧,第二次它在I=380时死了。以前有人见过这样的东西吗?
void PlotSpectrum(int []vData)
    {
        ArrayList listDataSource = new ArrayList();

        // Populate the list with records. 
        for (int i = 0; i < vData.Length; i++)
        {
            WriteGraph(Convert.ToString(vData[i]));
            listDataSource.Add(new Graph_Class(i, vData[i]));
        }

        // Bind the chart to the list. 
        ChartControl myChart = chartControl1;
        myChart.DataSource = listDataSource;

        // Create a series, and add it to the chart. 
        Series series1 = new Series("Spectrum", ViewType.Line);
        myChart.Series.Add(series1);

        // Adjust the series data members. 
         series1.ArgumentDataMember = "X";
       series1.ValueDataMembers.AddRange(new string[] { "Y" });

        // Access the view-type-specific options of the series. 
        ((LineSeriesView)series1.View).ColorEach = true;
        series1.LegendTextPattern = "{A}";
        try
        {
            //myChart.Update();
         //   myChart.Refresh();
        }catch(Exception err)
        {
            AppendTextBox(err.Message.ToString());
            print("Error in Graph: ", DateTime.Now.ToString(), err.Message.ToString());
        }
      
    }