如何重现:
我在另一台机器上运行没问题(在办公室,VS2010 Utimate)
但是我在家用电脑上遇到了这个例外(VS2010专业版)
异常详情: System.InvalidCastException:无法将类型为“System .__ ComObject”的COM对象强制转换为接口类型“EnvDTE.DTE”。 此操作失败,因为QueryInterface在具有IID的接口的COM组件上调用 '{04A72314-32E9-48E2-9B87-A63603454F3E}')由于以下错误而失败:接口未注册。 (HRESULT异常:0x80040155) 在Microsoft.Pex.VsPackage.VsServiceProviderHelper.GetService [T](IServiceProvider serviceProvider) 在Microsoft.Pex.VsPackage.Helpers.ProjectHelper.SaveAllFiles(IServiceProvider serviceProvider) 在Microsoft.Pex.VsPackage.Actions.ActionComponent.SaveAll() 在Microsoft.Pex.VsPackage.Actions.ExplorationActionBase.InternalExecute() 在Microsoft.Pex.VsPackage.Actions.ActionComponent.Execute(对象目标)
当前的堆栈跟踪 在Microsoft.Pex.VsPackage.Controls.ErrorReport.CreateReport(Exception ex) 在Microsoft.Pex.VsPackage.Controls.ErrorReport。<> c_ DisplayClass4.b _3() 在System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo方法,Object target,Object []参数,SignatureStruct& sig,MethodAttributes methodAttributes,RuntimeType typeOwner) 在System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo方法,Object target,Object []参数,Signature sig,MethodAttributes methodAttributes,RuntimeType typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,BindingFlags invokeAttr,Binder binder,Object [] parameters,CultureInfo culture,Boolean skipVisibilityChecks) 在System.Delegate.DynamicInvokeImpl(Object [] args) 在Microsoft.Pex.VsPackage.Helpers.UIThreadInvoker.SafeMethodInvoker.Invoke() 在System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo方法,Object target,Object []参数,SignatureStruct& sig,MethodAttributes methodAttributes,RuntimeType typeOwner) 在System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo方法,Object target,Object []参数,Signature sig,MethodAttributes methodAttributes,RuntimeType typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,BindingFlags invokeAttr,Binder binder,Object [] parameters,CultureInfo culture,Boolean skipVisibilityChecks) 在System.Delegate.DynamicInvokeImpl(Object [] args) 在System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme) 在System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj) 在System.Threading.ExecutionContext.runTryCode(Object userData) 在System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode代码,CleanupCode backoutCode,Object userData) 在System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,ContextCallback回调,对象状态) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback callback,Object state,Boolean ignoreSyncCtx) 在System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback回调,对象状态) 在System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme) 在System.Windows.Forms.Control.InvokeMarshaledCallbacks() 在System.Windows.Forms.Control.WndProc(消息& m) 在System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 在System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 在System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,Int32 msg,IntPtr wparam,IntPtr lparam)
相关环境变量: COR_ENABLE_PROFILER = COR_PROFILER = PROCESSOR_ARCHITECTURE = 86
机器数据: 处理器数= 4
答案 0 :(得分:0)
原来是一些奇怪的注册问题 重新安装Windows可以解决它