SourceTree has stopped working.
Asked by Jeff Starn:

I am using Windows 7 and Sourcetree 2.x. Previous answers on this forum were not helping. I uninstalled Sourcetree, removed all Atlassian and Sourcetree directories in localappdata and in c:\\program data, deleted everything I could in localappdata/temp (there's stilla file in use in use called "1"), and rebooted. Same thing, "Sourcetree has stopped working.

The Windows 7 Event Log shows 2 errors, Application and .NET Runtime. I tired poting the event log entries but was not allowed to do so.


Answers:
author: Mike Corsaro
body: Hello! Do you get a BugSplat crash dialog when this happens? Also, could you make sure your version of .NET is upgraded to the latest verison? Thanks!

comments: author: Jeff Starn
body: I'm using .NET Framework 4.6.2

Not sure where to check for bugsplat

localappdata/Atlassian/SourceTree/sourcetree.log is empty


author: Mike Corsaro
body: You would have seen a "Send crash report dialog". If possible, could you post the event log entries too? Thanks.


author: Jeff Starn
body: No "send crash report" dialog appeared.

I tried to send the event logs but got an error:

"Your reply was not accepted. Please check for inappropriate language or spam."


author: Mike Corsaro
body: Fill-free to just attach an image of the error and the details of the error.


author: Jeff Starn
body: ![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/1764iA023957EDB1A59E2/image-size/large?v=v2&px=999 "Capture.PNG")![Capture2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/1765iE73CFE3AFEC84968/image-size/large?v=v2&px=999 "Capture2.PNG")


author: Mike Corsaro
body: It sounds like WMI may have become corrupted. Could you try the following for me?

* Open up 'Computer Management' (Right click on the Windows 'start' button)
* Select 'Services and Applications' (left side panel)
* Right click on 'WMI Control' \> 'Properties'
* Check and see if the description under "General" lists any error or warning


author: Jeff Starn
body: I'm not seeing "Computer Management"

Under local services in Component Services I see WMI Performance Adapter and it's status is blank (i.e., not "Started")


author: Mike Corsaro
body: Hit WIN+R and type "compmgmt.msc" without the quotes. You may ignore the WMI Performance Adapter status.


author: Jeff Starn
body: ![Capture3.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/1766iA06122842DEEA472/image-size/large?v=v2&px=999 "Capture3.PNG")


author: Mike Corsaro
body: Ah, there's the answer: it looks like the "Win32_OperatingSystem" WMI object cannot be found (?!).

Check if the repository is corrupted or not by running following command from command prompt with **admin** rights: **winmgmt /verifyrepository**. If it is corrupted the returned result will be "Repository is inconsistent."

If it does not come back as consistent, you'll need to follow the steps [here.](https://blogs.technet.microsoft.com/askperf/2014/08/11/wmi-missing-or-failing-wmi-providers-or-invalid-wmi-class/)

You'll need to use "CIMWin32.mof" and "CIMWin32.dll"


author: Jeff Starn
body: It's running--taking a long time


author: Jeff Starn
body: The repo is inconsistent. I'm going to ask my IT department to take it from here, so there may be a delay in getting back to you.


author: Mike Corsaro
body: Got it -- thanks for the follow-up.


author: Jeff Starn
body: repaired WMI with:

winmgmt /salvagerepository

and then was able to successfully install sourcetree. Thanks for your help!


author: Mike Corsaro
body: Awesome! Glad to hear that!


author: kamatchi ramakrishnan
body: ![source tree.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/15602i79F9EED1E26A3F71/image-size/large?v=v2&px=999 "source tree.PNG")

I am also facing the similar issues..when i checked WMI control properties there is no issues in that.Can u please guide


author: mj-isip23
body: Hello [@Mike Corsaro](/t5/user/viewprofilepage/user-id/842547), I have the same problem but my WMI doesn't show any errors. Any chance that you could help me solve this problem?


author: EarthAdam
body: Same here. My WMI showed "Invalid Namespace", but the CMD returned "WMI repository is consistent"  
![WMI.png](https://community.atlassian.com/t5/image/serverpage/image-id/21055i5A0E3186EF84AA58/image-dimensions/278x316?v=v2 "WMI.png")  
When I try to debug it opens Visual Studio, but doesn't show anything other than "The application is in break mode"

![error.png](https://community.atlassian.com/t5/image/serverpage/image-id/21058i16AEC64112EDFB7D/image-dimensions/571x266?v=v2 "error.png")


author: Bruno Castro
body: Similar thing happened to me today, instead of "Not Found" the error was "WMI: Invalid class", I got it solved by following the instructions from TechNet Forum below:

<https://social.technet.microsoft.com/Forums/windowsserver/en-US/8c673b55-0db1-4ce1-bfaa-94527e8adb00/how-to-fix-quotinvalid-classquot-in-powershell?forum=winservergen>

Just in case I will copy paste the steps here too (it is also recommended to make a backup of the WMI repository).

. About how to rebuild the WMI repository.

? Disable and stop the winmgmt service  
? Remove or rename C:\\Windows\\System32\\wbem\\repository  
? Enable and start the winmgmt service  
? Open Command Prompt as Administrator  
? Run the following commands:

```
cd C:\Windows\System32\wbem\for /f %s in ('dir /b *.mof') do mofcomp %sNOTE: This will take a minute or so to complete.for /f %s in ('dir /b en-us\*.mfl') do mofcomp en-us\%s
```


author: David Storfer
body: My WMI was also not working, but I did not have quite the same errors as above and I did the following:

Go into dcomcnfg and try to look at the

Component services \> computers \> My computer \> Dcom config

It may prompt you for classes not registered. Say Yes! Once I did that, my WMI properties were working again and SourceTree reinstalled perfectly.