我的Visual Studio随机崩溃。事件查看器显示以下错误
错误应用程序名称:devenv.exe,版本:12.0.40629.0,时间 邮票:0x5590c8a4
错误模块名称:KERNELBASE.dll,版本: 10.0.15063.674,时间戳:0x6d16dd24
异常代码:0xe0434352
故障偏移:0x000eb872
错误进程ID:0x3b00
错误申请开始时间:0x01d34ecf7a049150
错误应用程序路径:C:\ Program Files(x86)\ Microsoft Visual Studio 12.0 \ Common7 \ IDE \ devenv.exe
错误模块路径:C:\ Windows \ System32 \ KERNELBASE.dll
报告ID:xxxxxxxx-867c-4c54-b259-c28a7b9d8151
错误包全名: 错误的包相关应用程序ID:
我尝试在(C:\ Program Files(x86)\ Microsoft Visual Studio 12.0 \ Common7 \ IDE)上运行devenv / SAFEMODE命令
但仍然会出现,有时会出现一个对话框“存储空间不足”
应用程序:devenv.exe
框架版本:v4.0.30319
描述:由于未处理的异常,该进程已终止。
异常信息:System.ComponentModel.Win32Exception at MS.Win32.UnsafeNativeMethods.RegisterClassEx(WNDCLASSEX_D)
活动记录
(0x80004005):没有足够的存储空间来处理此命令
在MS.Win32.UnsafeNativeMethods.RegisterClassEx(WNDCLASSEX_D wc_d)
在MS.Win32.HwndWrapper..ctor(Int32 classStyle,Int32 style,Int32 exStyle,Int32 x,Int32 y,Int32 width,Int32 height,String name,IntPtr parent,HwndWrapperHook [] hooks)
在System.Windows.Interop.HwndSource.Initialize(HwndSourceParameters参数)
在System.Windows.Interop.HwndSource..ctor(HwndSourceParameters参数)
在System.Windows.Controls.Primitives.Popup.PopupSecurityHelper.BuildWindow(Int32 x,Int32 y,Visual placementTarget,Boolean transparent,HwndSourceHook hook,AutoResizedEventHandler handler)
在System.Windows.Controls.Primitives.Popup.BuildWindow(Visual targetVisual)
在System.Windows.Controls.Primitives.Popup.CreateWindow(Boolean asyncCall)
在System.Windows.Controls.Primitives.Popup.OnIsOpenChanged(DependencyObject d,DependencyPropertyChangedEventArgs e)
在System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
在System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
在System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
在System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex,DependencyProperty dp,PropertyMetadata metadata,EffectiveValueEntry oldEntry,EffectiveValueEntry& newEntry,Boolean coerceWithDeferredReference,Boolean coerceWithCurrentValue,OperationType operationType)
在System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp,Object value,PropertyMetadata metadata,Boolean coerceWithDeferredReference,Boolean coerceWithCurrentValue,OperationType operationType,Boolean isInternal)
在System.Windows.DependencyObject.SetValue(DependencyProperty dp,Object value)
at Microsoft.VisualStudio.Language.Intellisense.Implementation.MouseTrackingQuickInfoPresenter.Render()
at Microsoft.VisualStudio.Language.Intellisense.Implementation.IntellisenseSessionStack.OnSessionPresenterChanged(Object sender,EventArgs e)
at Microsoft.VisualStudio.Language.Intellisense.Implementation.IntellisenseSession.RaisePresenterChanged()
at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Recalculate()
at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Start()
at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoBroker.TriggerQuickInfo(ITextView textView,ITrackingPoint triggerPoint,Boolean trackMouse)
at Microsoft.Html.Editor.HtmlQuickInfoController.OnMouseHover(Object sender,MouseHoverEventArgs e)
at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.RaiseHoverEvents()
我的应用程序在安全模式中运行一次或两次,然后即使退出也是如此。尝试重新启动visual studio时,它失败了。然后事件查看器或cmd提示不起作用,我必须重新启动我的机器以使某些工作。
看起来this和this是我的问题。现在我如何在我的代码中使用Dispatcher?
public string ConvertRtfToHtml(string rtfText)
{
try
{
var thread = new Thread(ConvertRtfInSTAThread);
var threadData = new ConvertRtfThreadData { RtfText = rtfText };
thread.SetApartmentState(ApartmentState.STA);
thread.Start(threadData);
try
{
thread.Join();
}
catch(ThreadStateException e){
logger.Error("ThreadStateException " + e.Message);
}
catch (ThreadInterruptedException e) {
logger.Error("ThreadInterruptedException " + e.Message);
}
return threadData.HtmlText;
}
catch (Exception e){
logger.Error("ConvertRtfToHtml: " + e.InnerException.Message);
return "Error";
}
}
从循环内调用 ConvertRtfToHtml ConvertRtfInSTAThread 使用RichTextBox控件