title: Interface not registered(0x80040155) when running Pex On Specific machine
body: <h2>Pex 0.94.0.0 Release Visual Studio 10.0.40219.1 Bug Report</h2>
  
  <p>How to reproduce:</p>
  
  <ol>
  <li>Open a class library project</li>
  <li>Create an empty method</li>
  <li>Right Click->Run Pex</li>
  </ol>
  
  <p>I run without problem on another machine (In Office, VS2010 Utimate)</p>
  
  <p>But I got this exception on my home computer(VS2010 Professtional)</p>
  
  <hr>
  
  <p>exception details:
  System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'EnvDTE.DTE'. 
  This operation failed because the QueryInterface call on the COM component for the interface with IID 
  '{04A72314-32E9-48E2-9B87-A63603454F3E}') failed due to the following error: Interface not registered. 
  (Exception from HRESULT: 0x80040155)
     at Microsoft.Pex.VsPackage.VsServiceProviderHelper.GetService[T](IServiceProvider serviceProvider)
     at Microsoft.Pex.VsPackage.Helpers.ProjectHelper.SaveAllFiles(IServiceProvider serviceProvider)
     at Microsoft.Pex.VsPackage.Actions.ActionComponent.SaveAll()
     at Microsoft.Pex.VsPackage.Actions.ExplorationActionBase.InternalExecute()
     at Microsoft.Pex.VsPackage.Actions.ActionComponent.Execute(Object target)</p>
  
  <hr>
  
  <p>Current stacktrace
     at Microsoft.Pex.VsPackage.Controls.ErrorReport.CreateReport(Exception ex)
     at Microsoft.Pex.VsPackage.Controls.ErrorReport.&lt;>c_<em>DisplayClass4.b</em>_3()
     at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct&amp; sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
     at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
     at System.Delegate.DynamicInvokeImpl(Object[] args)
     at Microsoft.Pex.VsPackage.Helpers.UIThreadInvoker.SafeMethodInvoker.Invoke()
     at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct&amp; sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
     at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
     at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
     at System.Delegate.DynamicInvokeImpl(Object[] args)
     at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
     at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
     at System.Threading.ExecutionContext.runTryCode(Object userData)
     at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
     at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
     at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
     at System.Windows.Forms.Control.WndProc(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
     at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)</p>
  
  <hr>
  
  <p>relevant environment variables:
  COR_ENABLE_PROFILER=
  COR_PROFILER=
  PROCESSOR_ARCHITECTURE=x86</p>
  
  <hr>
  
  <p>machine data:
  processor count = 4</p>