Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Sourcetree won't load

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()

4 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!

Like # people like this

@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/

Like # people like this

Thank you! Same thing happened to me. Windows 11 updated and then Sourcetree wouldn't load. And deleting the cache file fixed it.

Like # people like this

This worked for me, after Windows Update apparently screwed up Sourcetree.

Like # people like this

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! :-)

Like # people like this

Happened on Windows 10 too - so suspecting this month's .Net updates, applied yesterday.

Like Jonathan Folland likes this

this also worked for me and yes, also after Windows update

Like # people like this
Jonathan Folland, thank you.
Same situation happened to me. And deleting Composition.cache fixed the problem.
Like Matthew Sweeney likes this

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. 

Like Matthew Sweeney likes this

Thanks! this worked for me.

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 my hero Mr.Folland!

Jonathan Folland thank you for your answer, you have saved my time

Thanks so much, major time saver!

Can confirm, this worked for me as well.

Thank you!

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. :-)

Thank you, this worked for me

👍 Works like a charm! 😊

You saved my time! perfect worked for me.

Thank you, that fix solved it for me also!

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!

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.

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.

  • The error message you provided indicates that SourceTree is unable to load the MEF (Managed Extensibility Framework) components. The specific error encountered is "System.InvalidOperationException: Sequence contains no elements."
  • This error typically occurs when there is a problem with the installation or configuration of SourceTree's MEF components. Here are a few troubleshooting steps you can try to resolve the issue:

  • Restart your computer: Sometimes, a simple restart can resolve temporary issues with the application or its dependencies.
  • Update SourceTree: Ensure that you are using the latest version of SourceTree. Visit the official website or check for updates within the application itself.
  • Repair or reinstall SourceTree: Try repairing or reinstalling SourceTree to ensure that all necessary components are properly installed and configured. Uninstall SourceTree, restart your computer, and then install it again.
  • Clear SourceTree settings: There might be a corrupted configuration causing the issue. You can try clearing the SourceTree settings by deleting the following folder:
  • Windows: %LocalAppData%\Atlassian\SourceTree
0 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 15, 2019

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

I also have this problem. Has it been solved?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events