Wpf visual studio 2013 Xaml ui设计器在尝试添加事件时崩溃

Wpf visual studio 2013 Xaml ui设计器在尝试添加事件时崩溃,wpf,xaml,visual-studio-2013,Wpf,Xaml,Visual Studio 2013,每次我双击一个事件(在代码隐藏中自动添加事件模板),xaml ui设计器就会崩溃。以下是错误消息 System.Runtime.InteropServices.COMException Error HRESULT E_FAIL has been returned from a call to a COM component. at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCo

每次我双击一个事件(在代码隐藏中自动添加事件模板),xaml ui设计器就会崩溃。以下是错误消息

System.Runtime.InteropServices.COMException
Error HRESULT E_FAIL has been returned from a call to a COM component.
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at Microsoft.VisualStudio.CSharp.Services.Language.CodeModel.CCodeFunction.get_Type()
   at EnvDTE.CodeFunction.get_Type()
   at Microsoft.VisualStudio.ExpressionHost.Platform.DTECodeContext.CompatibleWith(CodeFunction function, IHostCodeEvent codeEvent)
   at Microsoft.VisualStudio.ExpressionHost.Platform.DTECodeContext.<Microsoft.Expression.DesignHost.IHostCodeContext.GetCompatibleMethods>d__9.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteHostCodeContext.<>c__DisplayClass13.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteHostCodeContext.GetCompatibleMethods>b__12()
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass2a`1.<MarshalIn>b__29()
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

System.Runtime.InteropServices.COMException
Error HRESULT E_FAIL has been returned from a call to a COM component.

Server stack trace: 
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalInSynchronous(Action action, Int32 targetApartmentId, CancellationToken cancelToken, CallModality callModality, String methodName, String filePath, Int32 lineNumber)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalIn(Action action, Int32 targetApartmentId, CancellationToken cancelToken, CallSynchronizationMode syncMode, CallModality callModality, String methodName, String filePath, Int32 lineNumber)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn(IRemoteObject targetObject, Action action, CallSynchronizationMode syncMode, CallModality callModality, ApartmentState apartmentState, String memberName, String filePath, Int32 lineNumber)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn[TResult](IRemoteObject targetObject, Func`1 func, CallModality callModality, ApartmentState apartmentState, String memberName, String filePath, Int32 lineNumber)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteHostCodeContext.Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteHostCodeContext.GetCompatibleMethods(String eventName, RemoteHostParameter[] parameters, String returnType)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteHostCodeContext.GetCompatibleMethods(String eventName, RemoteHostParameter[] parameters, String returnType)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalHostCodeContext.<>c__DisplayClass16.<Microsoft.Expression.DesignHost.IHostCodeContext.GetCompatibleMethods>b__15(IRemoteHostCodeContext cxt)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClassa`2.<MarshalOut>b__9()
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

System.Runtime.InteropServices.COMException
Error HRESULT E_FAIL has been returned from a call to a COM component.
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOutSynchronous(Action action, Int32 targetApartmentId, WaitHandle aborted, WaitHandle timeoutSignal, CancellationToken cancelToken, String methodName, String filePath, Int32 lineNumber)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(Action action, Int32 targetApartmentId, WaitHandle aborted, CancellationToken cancelToken, CallSynchronizationMode syncMode, WaitHandle timeoutSignal, String methodName, String filePath, Int32 lineNumber)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action action, CallSynchronizationMode syncMode, ApartmentState apartmentState, String methodName, String filePath, Int32 lineNumber)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle`1 targetObject, Func`2 func, CallSynchronizationMode syncMode, ApartmentState apartmentState, String methodName, String filePath, Int32 lineNumber)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalHostCodeContext.Microsoft.Expression.DesignHost.IHostCodeContext.GetCompatibleMethods(IHostCodeEvent codeEvent)
   at Microsoft.Expression.DesignSurface.UserInterface.PropertyInspector.CodeContext.CreateEventHandler(ISourceItemContext item, String typeName, IEvent eventKey, String methodName)
   at Microsoft.Expression.DesignSurface.UserInterface.PropertyInspector.EventHandlerProvider.CreateEventHandler(IEvent eventKey, String methodName)
   at Microsoft.Expression.DesignSurface.UserInterface.PropertyInspector.EventHandlerModel.SetMethodName(String newName)
   at Microsoft.Expression.DesignSurface.UserInterface.PropertyInspector.EventHandlerModel.GenerateAndCommit()
   at Microsoft.Expression.DesignSurface.UserInterface.PropertyInspector.EventHandlerModel.<get_GenerateAndCommitCommand>b__1(Object arg)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at Microsoft.Expression.DesignHost.Isolation.DesignerProcess.RunApplication()
   at Microsoft.Expression.DesignHost.Isolation.DesignerProcess.<>c__DisplayClass2.<Main>b__0()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
System.Runtime.InteropServices.COMException
调用COM组件时返回错误HRESULT E_FAIL。
在System.Runtime.InteropServices.Marshal.ThroweExceptionForhr内部(Int32 errorCode,IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.ThroweExceptionForHR(Int32错误代码)
位于Microsoft.VisualStudio.CSharp.Services.Language.CodeModel.CCodeFunction.get_Type()
在EnvDTE.CodeFunction.get_Type()处
位于Microsoft.VisualStudio.ExpressionHost.Platform.DTECodeContext.CompatibleWith(CodeFunction函数,IHostCodeEvent codeEvent)
在Microsoft.VisualStudio.ExpressionHost.Platform.dtecodecodext.d_u9.MoveNext()上
在System.Linq.Buffer`1..ctor处(IEnumerable`1源)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1源)
在Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteHostCodeContext.c__DisplayClass13.b__12()中
在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.c__DisplayClass2a`1.b__29()中
在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()中
System.Runtime.InteropServices.COMException
调用COM组件时返回错误HRESULT E_FAIL。
服务器堆栈跟踪:
位于Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext NestedCallContext,BlockingCall调用,WaitHandle timeoutSignal)
位于Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalInSynchronous(操作操作、Int32 TargetPartmentId、CancellationToken cancelToken、CallModality CallModality、String方法名、String文件路径、Int32行号)
位于Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalIn(操作操作、Int32 TargetPartmentId、CancellationToken cancelToken、CallSynchronizationMode syncMode、CallModalization CallModality、String方法名、String文件路径、Int32行号)
位于Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn(IRemoteObject targetObject,Action Action,CallSynchronizationMode syncMode,CallModalization CallModalization,ApartmentState ApartmentState,String memberName,String filePath,Int32 lineNumber)
在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn[TResult](IRemoteObject targetObject,Func`1 Func,CallModality CallModality,ApartmentState ApartmentState,String memberName,String filePath,Int32 lineNumber)
位于Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteHostCodeContext.Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteHostCodeContext.GetCompatibleMethods(String eventName,RemoteHostParameter[]参数,String returnType)
在System.Runtime.Remoting.Messaging.StackBuilderSink.\u PrivateProcessMessage(IntPtr md,对象[]参数,对象服务器,对象[]和输出参数)
在System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)中
在[0]处重试异常:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)
at System.Runtime.Remoting.proxy.RealProxy.PrivateInvoke(MessageData&msgData,Int32类型)
位于Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteHostCodeContext.GetCompatibleMethods(String eventName,RemoteHostParameter[]参数,String returnType)
在Microsoft.Expression.DesignHost.Isolation.Remoting.LocalHostCodeContext.c__DisplayClass16.b__15(IRemoteHostCodeContext cxt)中
在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.c__DisplayClassa`2.b__9()中
在Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()中
System.Runtime.InteropServices.COMException
调用COM组件时返回错误HRESULT E_FAIL。
位于Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext NestedCallContext,BlockingCall调用,WaitHandle timeoutSignal)
位于Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOutSynchronous(操作操作、Int32 TargetPartmentId、WaitHandle中止、WaitHandle timeoutSignal、CancellationToken cancelToken、String方法名、字符串文件路径、Int32行号)
位于Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(操作操作、Int32 TargetPartmentId、WaitHandle中止、CancellationToken cancelToken、CallSynchronizationMode syncMode、WaitHandle timeoutSignal、String方法名、String文件路径、Int32行号)
在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.Marshallout[TValue](RemoteHandle`1 targetObject,Action Action,CallSynchronizationMode syncMode,ApartmentState ApartmentState,String methodName,String filePath,Int32 lineNumber)
在Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.Marshallout[TResult,TValue](RemoteHandle`1 targetObject,Func`2 Func,CallSynchronizationMode syncMode,ApartmentState ApartmentState,String methodName,String filePath,Int32 lineNumber)
位于Microsoft.Expression.DesignHost.Isolation.Remoting.LocalHostCodeContext.Microsoft.Expression.DesignHost.IHostCodeContext.GetCompatibleMethods(IHostCodeEvent codeEvent)
位于Microsoft.Expression.DesignSurface.UserInterface.PropertyInspector.CodeContext.CreateEventHandler(ISourceItemContext项、字符串类型名、IEEvent事件键、字符串方法名)
位于Microsoft.Expression.DesignSurface.UserInterface.PropertyInspector.EventHandlerProvider.CreateEventHandler(IEEvent eventKey,String methodName)
位于Microsoft.Expression.DesignSurface.UserInterface.PropertyInspector.EventHandlerModel.SetMethodName(字符串newName)
在Microsoft.Expression.DesignSurface.UserInterface.PropertyInspector.EventHandlerModel.GenerateAndCommit()中
位于Microsoft.Expression.DesignSurface.UserInterface.PropertyInspector.EventHandlerModel.b__1(对象