应用程序崩溃并关闭了Visual Studio(2017)

时间:2019-01-25 23:10:55

标签: visual-studio-2017

我正在Visual Studio 2017 Enterprise中以发布模式运行我的Web api应用程序之一。过了一会儿,我回来了,发现视觉工作室没有启动并运行。我怀疑发生了什么事,并看到了应用程序日志,其中在Event Viewer应用程序中报告了错误的同时写了最后一个日志。错误的异常详细信息是:

  

应用程序:devenv.exe       框架版本:v4.0.30319       说明:由于未处理的异常,进程已终止。       异常信息:System.OutOfMemoryException          在Newtonsoft.Json.Utilities.BufferUtils.RentBuffer(Newtonsoft.Json.IArrayPool1,   Int32)          在Newtonsoft.Json.Utilities.JavaScriptUtils.WriteEscapedJavaScriptString(System.IO.TextWriter,   System.String,Char,Boolean,Boolean [],   Newtonsoft.Json.StringEscapeHandling,   Newtonsoft.Json.IArrayPool1,Char [] ByRef)          在Newtonsoft.Json.JsonTextWriter.WriteEscapedString(System.String,   布尔值)          在Newtonsoft.Json.JsonTextWriter.WriteValue(System.String)          在Newtonsoft.Json.Linq.JValue.WriteTo(Newtonsoft.Json.JsonWriter,   Newtonsoft.Json.JsonConverter [])          在Newtonsoft.Json.Linq.JArray.WriteTo(Newtonsoft.Json.JsonWriter,   Newtonsoft.Json.JsonConverter [])          在Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(Newtonsoft.Json.JsonWriter,   System.Object,Newtonsoft.Json.Serialization.JsonContract,   Newtonsoft.Json.Serialization.JsonProperty,   Newtonsoft.Json.Serialization.JsonContainerContract,   Newtonsoft.Json.Serialization.JsonProperty)          在Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(Newtonsoft.Json.JsonWriter,   System.Object,Newtonsoft.Json.Serialization.JsonObjectContract,   Newtonsoft.Json.Serialization.JsonProperty,   Newtonsoft.Json.Serialization.JsonContainerContract,   Newtonsoft.Json.Serialization.JsonProperty)          在Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(Newtonsoft.Json.JsonWriter,   System.Object,Newtonsoft.Json.Serialization.JsonContract,   Newtonsoft.Json.Serialization.JsonProperty,   Newtonsoft.Json.Serialization.JsonContainerContract,   Newtonsoft.Json.Serialization.JsonProperty)          在Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(Newtonsoft.Json.JsonWriter,   System.Object,System.Type)          在Newtonsoft.Json.JsonSerializer.SerializeInternal(Newtonsoft.Json.JsonWriter,   System.Object,System.Type)          在Newtonsoft.Json.JsonConvert.SerializeObjectInternal(System.Object,   System.Type,Newtonsoft.Json.JsonSerializer)          在StreamJsonRpc.JsonRpc.TransmitAsync(StreamJsonRpc.JsonRpcMessage,   System.Threading.CancellationToken)          在StreamJsonRpc.JsonRpc + d__67`1 [[System .__ Canon,   mscorlib,版本= 4.0.0.0,文化=中性,   PublicKeyToken = b77a5c561934e089]]。MoveNext()          在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)处          在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)处          在Microsoft.DiagnosticsHub.VisualStudio.DataWarehouse.DataWarehouseServiceHubHost + ServiceHubControllerBase + d__7.MoveNext()          在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)处          在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)处          在Microsoft.DiagnosticsHub.VisualStudio.DataWarehouse.DataWarehouseServiceHubHost + d__38.MoveNext()          在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)处          在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)处          在Microsoft.DiagnosticsHub.VisualStudio.DataWarehouse.DataWarehouseInstance + d__41.MoveNext()          在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)处          在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)处          在Microsoft.DiagnosticsHub.Views.CollectionDataCountersService + d__38.MoveNext()          在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)处          在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)处          在Microsoft.DiagnosticsHub.Views.CollectionDataCountersService + d__37.MoveNext()          在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)处          在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)处          在Microsoft.DiagnosticsHub.Views.CollectionDataCountersService + d__36.MoveNext()          在System.Runtime.CompilerServices.AsyncMethodBuilderCore + <> c.b__6_1(System.Object)          在System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)          在System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,   System.Threading.ContextCallback,System.Object,布尔值)          在System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,   System.Threading.ContextCallback,System.Object,布尔值)          在System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()          在System.Threading.ThreadPoolWorkQueue.Dispatch()          在System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

我非常确定这是我的应用程序,因为它使用Newtonsoft Json。假设我是对的,这看起来像是我的应用程序中的内存泄漏。我应该如何找出泄漏点在哪里?记住,我正在Visual Studio 2017(企业版)中以发布模式运行。

有什么建议吗?

0 个答案:

没有答案