2010-06-04 106 views
2

我在打開一臺計算機上的WPF用戶控件時,出現Visual Studio 2010崩潰問題。無論何時我打開任何WPF用戶控件或嘗試在我們的產品解決方案(解決方案中的任何項目)中創建新的WPF用戶控件時,Visual Studio都會崩潰。Visual Studio 2010崩潰,打開WPF用戶控件

我已經卸載或禁用了所有Visual Studio加載項(如ReSharper和.NET Reflector)並重新安裝了Visual Studio 2010本身(以及Silverlight和.NET Framework 4.0),但這並沒有幫助。

我可以創建一個新的WPF解決方案,WPF編輯器可以成功啓動新創建的窗口。但是,在其他類似配置的計算機上,我們可以成功打開我們產品解決方案中的用戶控件,以便解決方案或用戶控件本身不會出現問題。

在崩潰的錯誤報告中的信息是這樣的:

事件類型:clr20r3 P1:devenv.exe的P2:10.0.30319.1 P3:4ba1fab3 P4:microsoft.visualstudio.shell.10.0 P5:10.0 .0.0 P6:4ba1e1f5
P7:506 P8:13點P9信息:system.ArgumentNullException

如果我在崩潰期間調試Visual Studio中,墜機調用堆棧看起來是這樣的:

Microsoft.VisualStudio.Shell .10.0.dll!Microsoft.VisualStudio.Shell.Ser viceProvider.ServiceProvider(Microsoft.VisualStudio.OLE.Interop.IServiceProvider sp,bool defaultServices)+ 0x48 bytes Microsoft.VisualStudio.Xaml.dll!MS.Internal.Package.Toolbox.AutoToolboxProjectManager.VSProject.get()+ 0x7c bytes Microsoft .VisualStudio.Xaml.dll!MS.Internal.Package.Toolbox.AutoToolboxProjectManager.AutoToolboxProjectManager(Microsoft.VisualStudio.Shell.Interop.IVsHierarchy hierarchy,System.IServiceProvider provider,Microsoft.VisualStudio.Shell.Interop.IVsSmartOpenScope smartOpenScope)+ 0x109 bytes Microsoft.VisualStudio.Xaml.dll!MS.Internal.Package.Toolbox.AutoToolboxManagerService.Update(Microsoft.VisualStudio.Shell.Interop.IVsHierarchy hierarchy = {System .__ ComObject},bool force = false)+ 0x7a bytes Microsoft.VisualStudio。 Xaml.dll!MS.Internal.Package.Toolbox.AutoToolboxManagerService.Start()+ 0x81 bytes Microsoft.VisualStudio.Xaml.dll!MS.Internal.Package.DesignerPackage.Initialize.AnonymousMethod__0(對象ARG)+ 0xd中字節

WindowsBase.dll中!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback,object args,int numArgs)行111 + 0xb字節C# WindowsBase.dll!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(object source = {System.Windows.Threading.Dispatcher},System.Delegate method,object args, int numArgs,System.Delegate catchHandler = null)Line 41 + 0xd bytes C# WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl()Line 360​​ + 0x52 bytes C# WindowsBase.dll!System.Windows.Threading.DispatcherOperation .InvokeInSecurityContext(對象狀態)行337 + 0x7的字節C# mscorlib.dll中!System.Threading.ExecutionContext.runTryCode(對象的UserData)線484 + 0xe字節C# [原產於託管過渡]
[託管到純過渡]
mscorlib.dll中!系統。 Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext,System.Threading.ContextCallback callback,object state)Line 461 + 0x12 bytes C# mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext,System .Threading.ContextCallback回調,對象狀態,布爾ignoreSyncCtx)行447 + 0xd字節C# mscorlib。dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext,System.Threading.ContextCallback callback,object state)Line 411 + 0xc bytes C# WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke()Line 303 + 0xffffff73 bytes C# WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue()Line 1567 C# WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(System.IntPtr hwnd,int msg,System.IntPtr wParam,System.IntPtr lParam,ref bool handling)Line 1811 C# WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd = 2032464,int msg = 49716,System.IntPtr wParam = 0,System.IntPtr lParam = 0,ref bool handles = false)行344 + 0x15字節C# WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o)Line 494 + 0x18 bytes C# WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback,object args,int numArgs)Line 111 + 0xb bytes C# WindowsBase.dll!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(object source = {System.Windows.Threading.Dispatcher},System.Delegate方法,對象args,int numArgs,System.Delegate catchHandler = null)41行+ 0xd字節C# WindowsBase.dll!System.Windows.Threading.Dispatcher.InvokeImpl(System Windows.Threading.DispatcherPriority優先級,System.TimeSpan超時,System.Delegate方法,對象參數, int msg = 49716,System.IntPtr wParam = 0,System.IntPtr lParam = 0)398行C#

+0

(我可以看到它已經有一段時間了)你有沒有試過要求微軟檢查你在Microsoft Connect上的崩潰?如果是這樣,你能把這個問題與這個討論聯繫起來嗎? – GregC 2011-04-15 21:47:01

回答

2

我會建議你在自定義控件中的每個事件處理程序周圍放置一個try/catch塊,如果可能的話。