I've been using SourceTree for months and this morning it won't load. The splash screen comes up and the disappears. I checked the log and the following error was logged with every attempt at launching it:
ERROR [2019-05-09 09:17:39,903] [1] [Sourcetree.Composition.VSMef.Net471.VSMefCompositionManager] [Log] - Unable to load MEF components
System.InvalidOperationException: Sequence contains no elements
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at Microsoft.VisualStudio.Composition.PartDiscovery.GetElementTypeFromMany(Type type)
at Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeImport.get_ImportingSiteTypeWithoutCollection()
at Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeImport.get_IsLazy()
at Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeImport.get_LazyFactory()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.SatisfyImports()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.SatisfyImmediateImports()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func`3 lazyFactory)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.<CreateValue>b__10_0(RuntimeImport import)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func`3 lazyFactory)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.<CreateValue>b__10_0(RuntimeImport import)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func`3 lazyFactory)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.<CreateValue>b__10_0(RuntimeImport import)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func`3 lazyFactory)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.<CreateValue>b__10_0(RuntimeImport import)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.<>c__DisplayClass15_0.<GetExportedValueHelper>b__0()
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func`3 lazyFactory)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.<CreateValue>b__10_0(RuntimeImport import)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)
at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at Microsoft.VisualStudio.Composition.NetFxAdapters.MefV1ExportProvider.<>c__DisplayClass12_0.<UnwrapExport>b__1()
at System.ComponentModel.Composition.Primitives.Export.get_Value()
at System.ComponentModel.Composition.ReflectionModel.ImportingItem.Cast(Type type, Export export)
at System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.SetImport(ImportingItem item, Export[] exports)
at System.ComponentModel.Composition.Hosting.ImportEngine.PartManager.TrySetImport(ImportDefinition import, Export[] exports)
at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportSubset(PartManager partManager, IEnumerable`1 imports, AtomicComposition atomicComposition)
at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportsStateMachine(PartManager partManager, ComposablePart part)
at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImports(PartManager partManager, ComposablePart part, Boolean shouldTrackImports)
at System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImportsOnce(ComposablePart part)
at System.ComponentModel.Composition.Hosting.CompositionContainer.SatisfyImportsOnce(ComposablePart part)
at System.ComponentModel.Composition.AttributedModelServices.SatisfyImportsOnce(ICompositionService compositionService, Object attributedPart)
at Sourcetree.Composition.VSMef.Net471.VSMefCompositionManager.<Compose>d__5.MoveNext()
Community moderators have prevented the ability to post new answers.
I deleted file "\AppData\Local\Atlassian\SourceTree.exe_Url_lt03l1ybxwq1qoho5ydpzegbicen0mbc\3.4.11.0\Composition.cache"
This resolved the issue for me and so far I have not seen any issues.
This is the perfect fix!
For those who stumble across this with the same issue.
Last night I left my laptop on stand by with Sourcetree and Visual Studio open.
Windows decided to do a security update overnight so Sourcetree showed this exact issue in the morning.
I reversed the update but the corruption of the cache remained. Removing this file and relaunching the software resolved my issue as it rebuilt the cache with the new information.
I have logged a complaint with Microsoft as this looks like a .NET/Visual Studio issue caused by the changes in their update.
Thank you for the help Jonathan, absolute lifesaver!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jonathan Folland thank you, life saver, it did work form me too. The same problem happened after a Windows 11 update. After the update and the reboot, Sourcetree 3.4.13 just shown his splash screen and then crashed.
To help others, you can just rename the file without deleting it.
Be aware that you need to find the folder with your current/latest version (as you can have many similar folders with different IDs) and rename `Composition.cache` to `_Composition.cache` and then start Sourcetree. A new `Composition.cache` file will appear.
Out of curiosity, I did compare the two (binary) files, and found out that the only change was related to the `Sourcetree` folder renamed in `SourceTree` 🤣
Ex:
before => C:/Users/[user]/AppData/Local/Sourcetree/app-3.4.13/
after => C:/Users/[user]/AppData/Local/SourceTree/app-3.4.13/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you! Same thing happened to me. Windows 11 updated and then Sourcetree wouldn't load. And deleting the cache file fixed it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This worked for me, after Windows Update apparently screwed up Sourcetree.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same for me, the new Windows 11 update crashed my SourceTree installation. I deleted the cache file, and now it works again! Thanks a lot! :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Happened on Windows 10 too - so suspecting this month's .Net updates, applied yesterday.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this also worked for me and yes, also after Windows update
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
RIGHT ON!
Thanks for this; I just spent an hour trying to debug this, looking for errors in the sourcetree.log file after the app failed to launch. I'm amused by how much attention this post received yesterday after being dormant for so long.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks! this worked for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You saved my life!! This worked and I found this post/solution right as I was about to uninstall and reinstall SourceTree and rebuild my project and server access etc. That would have been very painful. I renamed the cache file and everything worked again.
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jonathan Folland thank you for your answer, you have saved my time
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks so much, major time saver!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can confirm, this worked for me as well.
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much, this worked for me. How did you get to this solution of removing this particular file? I am curious to know the thought process.
p.s. In hindsight, now that you have mentioned that Composition.cache needs to be deleted, there are related error entries in log file that mention Composition (Microsoft.VisualStudio.Composition.PartDiscovery.GetElementTypeFromMany)
But I would never have reached to this solution by looking at these entries. :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, this worked for me
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
👍 Works like a charm! 😊
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You saved my time! perfect worked for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, that fix solved it for me also!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Worked for me too! Thanks!
Seems like with all the increased security updates to our computers, we are now spending significant time troubleshooting post-security-update issues!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
SAME SAME.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
None of this worked for me. Apparently the folder names were mixed up. My executable is in AppData\Local\SourceTree\app-3.4.2 and the config of Atlassion appeared to be in \AppData\Local\Atlassian\SourceTree.exe_{ID}\3.4.2.0
I renamed the first folder to app-3.4.2.0 (so I added the 0) and then it started a fresh registration os Sourcetre. Did not complete this but killed it and changed the folder name back to app-3.4.2 and it started properly again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yep, I've tried your solution and works.
By the way I rename the folder back to origin name again and all the settings and repos keep the same.
And a prompt with temp files shown, I think this is the root cause why the source tree not loaded.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Will,
Are you still experiencing this issue?
I've checked the log and I can see several mentions of Visual Studio, are you using Sourcetree with Visual Studio? Can you try wiping Sourcetree preferences and starting it again, and see if this time it works?
If you're still having issues, can you let us know which Sourcetree and Windows version are you using, so we can help you troubleshoot this issue?
Best regards,
Ana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also have this problem. Has it been solved?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.