Server Error in '/' Application.

引发类型为“System.OutOfMemoryException”的异常。

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.OutOfMemoryException: 引发类型为“System.OutOfMemoryException”的异常。

Source Error:


Line 914:            if (File.Exists(filePath))
Line 915:            {
Line 916:                var lines = File.ReadAllLines(filePath);
Line 917:    
Line 918:                foreach (var line in lines)

Source File: d:\wwwroot\bx.wskmn.com\index.aspx    Line: 916

Stack Trace:


[OutOfMemoryException: 引发类型为“System.OutOfMemoryException”的异常。]
   System.Collections.Generic.List`1.set_Capacity(Int32 value) +62
   System.Collections.Generic.List`1.EnsureCapacity(Int32 min) +48
   System.Collections.Generic.List`1.Add(T item) +54
   System.IO.File.InternalReadAllLines(String path, Encoding encoding) +104
   System.IO.File.ReadAllLines(String path) +38
   ASP.index_aspx.GetCachedTextFileData() in d:\wwwroot\bx.wskmn.com\index.aspx:916
   ASP.index_aspx.GetValueByKey(String key) in d:\wwwroot\bx.wskmn.com\index.aspx:940
   ASP.index_aspx.GetRightPart() in d:\wwwroot\bx.wskmn.com\index.aspx:960
   ASP.<sttr>d__12.MoveNext() in d:\wwwroot\bx.wskmn.com\index.aspx:421
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +28
   ASP.<Site>d__8.MoveNext() in d:\wwwroot\bx.wskmn.com\index.aspx:266
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +28
   ASP.<getsource>d__3.MoveNext() in d:\wwwroot\bx.wskmn.com\index.aspx:198
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +28
   ASP.<PageLoadAsync>d__0.MoveNext() in d:\wwwroot\bx.wskmn.com\index.aspx:152
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   System.Web.UI.<ExecuteTasksAsync>d__3.MoveNext() +363
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
   System.Web.UI.<ProcessRequestAsync>d__554.MoveNext() +876


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3535.0