Sourcetree installer Failed to start System.Management.ManagementException: Invalid class
Asked by Yv?n Ecarri _RiM_:

As soon as I start SourceTreeSetup-3.4.10.exe it crashes with this error. Does anybody how to workaround it?

```
2022-11-21T14:39:36: LogHost: Initializing to normal mode
ERROR [2022-11-21 14:39:39,155] [1] [SourceTree.App] [Log] - Failed to start
System.Management.ManagementException: Invalid class 
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
at SourceTree.UI.Theme.Wpf.Utilities.NativeHelper.GetWindowsVersion()
at SourceTree.UI.Theme.Wpf.Controls.PerMonitorDpiWindow.OnSourceInitialized(EventArgs e)
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.ShowDialog()
at SourceTree.UI.WelcomeWizardManager.Run()
at SourceTree.UI.OnboardingManager.Run()
at SourceTree.AppRoot.Onboard()
at SourceTree.AppRoot.OnboardIfRequired()
at SourceTree.AppRoot.<OnStartup>d__24.MoveNext()
```


Answers:
author: Mukesh Kumar
body: Hi [@Yv?n Ecarri _RiM_](/t5/user/viewprofilepage/user-id/5084248)

The issue has been already identified and fixed and will be available in the next coming release soon.

comments: author: dwangerin
body: Hello! Do you have an idea of when the release with this fix will be available? I, too, am having the same problem.


author: Mukesh Kumar
body: Sourcetree 3.4.11 release will be available by 3rd week of December 2022.


author: Daniel ddd
body: Great but what is the workaround till then?


author: Mukesh Kumar
body: Please download the Sourcetree 3.4.11 from <https://product-downloads.atlassian.com/software/sourcetree/windows/ga/SourceTreeSetup-3.4.11.exe>


author: florianbrossier
body: Hi [@Mukesh Kumar](/t5/user/viewprofilepage/user-id/4883692)

I have a same problem than [@Yv?n Ecarri _RiM_](/t5/user/viewprofilepage/user-id/5084248)

I installed sourcetree 3.4.11 and the same errors :

```
LogHost: Initializing to normal mode
[SourceTree.App] [Log] - Failed to start System.Management.ManagementException: Invalid class 
```

Can we help me please ?


author: Daniel ddd
body: [@Mukesh Kumar](/t5/user/viewprofilepage/user-id/4883692) , after fresh installation situation does look in the very same way:

ERROR \[2022-12-18 22:50:18,670\] \[1\] \[SourceTree.App\] \[Log\] - Failed to start  
System.Management.ManagementException: Invalid class  
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)  
at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()  
at SourceTree.UI.Theme.Wpf.Utilities.NativeHelper.GetWindowsVersion()  
at SourceTree.UI.Theme.Wpf.Controls.PerMonitorDpiWindow.OnSourceInitialized(EventArgs e)  
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)  
at System.Windows.Window.ShowHelper(Object booleanBox)  
at System.Windows.Window.ShowDialog()  
at SourceTree.UI.WelcomeWizardManager.Run()  
at SourceTree.UI.OnboardingManager.Run()  
at SourceTree.AppRoot.Onboard()  
at SourceTree.AppRoot.OnboardIfRequired()  
at SourceTree.AppRoot.\<OnStartup\>d__24.MoveNext()  
--- End of stack trace from previous location where exception was thrown ---  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()  
at SourceTree.App.\<OnStartup\>d__9.MoveNext()


author: Daniel ddd
body: [@Mukesh Kumar](/t5/user/viewprofilepage/user-id/4883692) , another thing is that installation really behaves weird... There is no messsage at the end of installation about success or completion. It just disappears...


author: Matthew McGuinness
body: I'm getting the same issue even after upgrading to 3.4.11 and I'm having the issue with the installer disappearing too. Both on install and uninstall  

*** ** * ** ***

<br />

Edit: After searching online I rebuilt my WMI repository and that resolved the issue. When I went into wmimgmt.msc I saw that the Win32_processor and Win32_WMISetting all had invalid class errors. I rebuilt the repo and rebooted and Sourcetree was functioning again. I believe the issue with the WMI repo came from a bad Windows Update


author: dwangerin
body: Thank you, Matthew! Your information was very helpful!


author: klorinczi
body: I have the same error after installing SourceTreeSetup-3.4.11.exe.

```
2023-02-26T18:59:38: LogHost: Initializing to normal mode
ERROR [2023-02-26 18:59:43,588] [1] [SourceTree.App] [Log] - Failed to start
System.Management.ManagementException: Invalid class 
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
at SourceTree.UI.Theme.Wpf.Utilities.NativeHelper.GetWindowsVersion()
at SourceTree.UI.Theme.Wpf.Controls.PerMonitorDpiWindow.OnSourceInitialized(EventArgs e)
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.ShowDialog()
at SourceTree.UI.WelcomeWizardManager.Run()
at SourceTree.UI.OnboardingManager.Run()
at SourceTree.AppRoot.Onboard()
at SourceTree.AppRoot.OnboardIfRequired()
at SourceTree.AppRoot.<OnStartup>d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at SourceTree.App.<OnStartup>d__9.MoveNext()
ERROR [2023-02-26 19:03:20,312] [1] [SourceTree.App] [Log] - Failed to start
System.Management.ManagementException: Invalid class 
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
at SourceTree.UI.Theme.Wpf.Utilities.NativeHelper.GetWindowsVersion()
at SourceTree.UI.Theme.Wpf.Controls.PerMonitorDpiWindow.OnSourceInitialized(EventArgs e)
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.ShowDialog()
at SourceTree.UI.WelcomeWizardManager.Run()
at SourceTree.UI.OnboardingManager.Run()
at SourceTree.AppRoot.Onboard()
at SourceTree.AppRoot.OnboardIfRequired()
at SourceTree.AppRoot.<OnStartup>d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at SourceTree.App.<OnStartup>d__9.MoveNext()
ERROR [2023-02-26 19:04:50,450] [1] [SourceTree.App] [Log] - Failed to start
System.Management.ManagementException: Invalid class 
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
at SourceTree.UI.Theme.Wpf.Utilities.NativeHelper.GetWindowsVersion()
at SourceTree.UI.Theme.Wpf.Controls.PerMonitorDpiWindow.OnSourceInitialized(EventArgs e)
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.ShowDialog()
at SourceTree.UI.WelcomeWizardManager.Run()
at SourceTree.UI.OnboardingManager.Run()
at SourceTree.AppRoot.Onboard()
at SourceTree.AppRoot.OnboardIfRequired()
at SourceTree.AppRoot.<OnStartup>d__24.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at SourceTree.App.<OnStartup>d__9.MoveNext()
```

This should be fixed in the code.