SourceTree won't start - Unable to load MEF components
Asked by Sven Schuchmann:

Hi,

I am using SourceTree Enterprise 3.4.13.0 on Windows 10.  
After a Windows Update Today it does not start anymore.  
Only see splash screen then it closes.  
Tried uninstalling Reinstalling, nothing helped.  

In the SourceTree.log I see this error:

```
ERROR [2023-06-14 09:23:59,047] [1] [Sourcetree.Composition.VSMef.Net48.VSMefCompositionManager] [Log] - Unable to load MEF components
System.InvalidOperationException: Die Sequenz enth?lt keine Elemente.
bei System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
bei Microsoft.VisualStudio.Composition.PartDiscovery.GetElementTypeFromMany(Type type)
bei Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeImport.get_ImportingSiteTypeWithoutCollection()
bei Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeImport.get_IsLazy()
bei Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeImport.get_LazyFactory()
bei Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)
bei Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.SatisfyImports()
...
```

Can anyone help?


Answers:
author: Sven Schuchmann
body: Deleting

```
%LOCALAPPDATA%\Atlassian\SourceTree.exe_<UID>\3.4.13.0\Assemblies.cache
%LOCALAPPDATA%\Atlassian\SourceTree.exe_<UID>\3.4.13.0\Composition.cache
```

helped!

comments: author: Richard Jackson
body: This worked for me too


author: Tomas Franco
body: Thank you so much glad someone was able to solve this.


author: Kevin Henderson
body: Same issue for me and this worked. Thanks!


author: Oddvar Gjerde
body: Very helpful for me too


author: Heidi Bickner
body: Very helpful. Thanks for posting!


author: Jachin Collins
body: FYI - On my machine, the files were located under the **Atlassian** folder:

%LOCALAPPDATA%\\Atlassian\\SourceTree.exe_\<UID\>\\\<Version\>\\


author: Heidi Bickner
body: [@Jachin Collins](/t5/user/viewprofilepage/user-id/5243575)Same


author: Sven Schuchmann
body: [@Jachin Collins](/t5/user/viewprofilepage/user-id/5243575) Correct, I fixed that in my answer.


author: COMM_IT
body: Worke for me as well, thanks!


author: ???
body: ?????. ??? ?? ????!


author: FrogsInSpace
body: Seems that this issue reappears and the above fix has to be applied repeatetly  
So i downgraded to 3.4.12 and the issue is gone

Seems to be some deeper issue with the 3.4.13 version


author: Michael Eacott
body: Thanks for posting. This worked for me.


author: Chris Plenter
body: Works! Thanks for the post!


author: Jordan Brobyn
body: Worked for me


author: Liam Murphy
body: Worked for me after this weeks regular windows update that I declined but somehow it was applied regardless. For what its worth these are the folders in which I needed to delete those files:

C:\\Users\\\*\*me\*\*\\AppData\\Local\\Atlassian\\SourceTree.exe_Url_re5thcoffnnkdlp540ilqzrn33oj41rm\\3.4.3.0

C:\\Users\\\*\*me\*\*\\AppData\\Local\\Atlassian\\SourceTree.exe_Url_n3rdypildipi022uybkie3xafvtaqehx\\3.4.8.0


author: Andrew Neil
body: Worked here too! Awesome!


author: Patrik Foldes
body: Thanks, helped me too


author: arizagaander
body: Same problem. Solution works like a charm

Thanks!


author: Samantha Roderigues
body: worked for me too thanks!


author: Ravichandran M Kaushika
body: Worked for me - thanks a bunch.


author: Teddy Saputra
body: Worked perfectly thanks!


author: Joel Blake
body: Worked for me!


author: oksana_vovere
body: Thanks!


author: Prashanth Bala
body: Thanks, that worked for me!


author: Ivan Lopez
body: It works for me too. Thanks a lot!!!!


author: Eric Yu
body: It works for me too, thanks!


author: Paresh Awashank
body: Worked for me.. thanks!!!


author: Darren Capner
body: This worked for me. Thanks!


author: Qreesna
body: Thanks. It works!


author: Mart? P?mies Sol?
body: Thks so much. it works


author: FerneyMartinez
body: Thanks so much. It worked like a charm!!


author: jszbps
body: This worked!

"Unable to load MEF components" is not a bug, it's a feature! This happens so frequently it's disturbing why developers do not fix this or auto-remediate for this issue. Incredibly frustrating when this happens.

EDIT: Got tired of this issue happening so often, even on latest version at time of writing, so I stopped using Atlassian SourceTree altogether and started using something else.


author: gmayer
body: Thank you so much!!


author: Charles Benson
body: Thank you so very much! A big relief. Thank you.


author: charlesstanding
body: This worked beautifully (on v 3.4.11). Thank you so much!


author: Graeme Whiting
body: Worked for me in 3.4.13, now I'll upgrade :-)


author: Charles E Lewis Jr
body: Brilliant! Thank you.


author: Mukesh Kumar
body: We have fixed this issue in Sourcetree 3.4.14 and is available for upgrade.


author: Harry Playfair
body: Exact same issue here, deleting the single file solved it:

```
Composition.cache
```

However, the problem has recurred twice - will we see a fix soon?


author: Caleb Widmer
body: came here same reason,  
thanks for the work arounds.  
Uninstall/reinstall seems to work at least from SourceTree-3.4.8 to 3.4.13


author: Richard Jackson
body: I have the same issue

comments: author: Sven Schuchmann
body: Can you check my answer below helps?


author: Richard Jackson
body: yes, its fixed


author: zsw
body: Thank for you help?


author: Eric Bongaerts
body: Works for me as well. Thnx!


author: Radek Havelka
body: had the same issue, deleting the files helped, thanks !


author: Ivan Lopez
body: It works for me too. Thanks a lot!!


author: Sean Lively
body: My entire team got bit by this bug after recent windows updates.

comments: author: StuartWhiting
body: same thing happened here. glad to find this post quickly.


Tags: atl-orange