TheSourceTree cannot be opened
Asked by Mikhail Khizhnyakov:

SourceTree cannot be opened (Windows 10). Only Splash screen is shown temporarily and then nothing. Can someone suggest a solution?


Answers:
author: Daniel Ebers
body: Hi Mikhail,

welcome to the Atlassian Community!

Have you had the chance to look into logs?  
Probably an error is logged there pointing to a possible cause?

<https://confluence.atlassian.com/sourcetreekb/sourcetree-logfile-location-675384748.html>  

Let us know if you found something out!

Regards,  
Daniel

comments: author: vhavard
body: I have got this error:

ERROR \[2023-06-14 09:12:04,057\] \[1\] \[Sourcetree.Composition.VSMef.Net471.VSMefCompositionManager\] \[Log\] - Unable to load MEF components  
System.InvalidOperationException: La s?quence ne contient aucun ?l?ment.  
? System.Linq.Enumerable.First\[TSource\](IEnumerable\`1 source)  
? Microsoft.VisualStudio.Composition.PartDiscovery.GetElementTypeFromMany(Type type)  
? Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeImport.get_ImportingSiteTypeWithoutCollection()  
? Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeImport.get_IsLazy()  
? Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeImport.get_LazyFactory()  
? Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)  
? Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.SatisfyImports()  
? Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.SatisfyImmediateImports()  
? Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)  
? Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)  
? Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()  
? Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.\<\>c__DisplayClass15_0.\<GetExportedValueHelper\>b__0()  
? Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func\`3 lazyFactory)  
? Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)  
? Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.\<CreateValue\>b__10_0(RuntimeImport import)  
? System.Linq.Enumerable.WhereSelectArrayIterator\`2.MoveNext()  
? System.Linq.Buffer\`1..ctor(IEnumerable\`1 source)  
? System.Linq.Enumerable.ToArray\[TSource\](IEnumerable\`1 source)  
? Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()  
? Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()  
? Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)  
? Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)  
? Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()  
? Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.\<\>c__DisplayClass15_0.\<GetExportedValueHelper\>b__0()  
? Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import, RuntimeExport export, Func\`3 lazyFactory)  
? Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(RuntimePartLifecycleTracker importingPartTracker, RuntimeImport import)  
? Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.\<CreateValue\>b__10_0(RuntimeImport import)  
? System.Linq.Enumerable.WhereSelectArrayIterator\`2.MoveNext()  
? System.Linq.Buffer\`1..ctor(IEnumerable\`1 source)  
? System.Linq.Enumerable.ToArray\[TSource\](IEnumerable\`1 source)  
? Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()  
? Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()  
? Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)  
? Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)  
? Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()  
? System.Lazy\`1.CreateValue()  
? System.Lazy\`1.LazyInitValue()  
? Microsoft.VisualStudio.Composition.NetFxAdapters.MefV1ExportProvider.\<\>c__DisplayClass12_0.\<UnwrapExport\>b__1()  
? System.ComponentModel.Composition.Primitives.Export.get_Value()  
? System.ComponentModel.Composition.ReflectionModel.ImportingItem.Cast(Type type, Export export)  
? System.ComponentModel.Composition.ReflectionModel.ReflectionComposablePart.SetImport(ImportingItem item, Export\[\] exports)  
? System.ComponentModel.Composition.Hosting.ImportEngine.PartManager.TrySetImport(ImportDefinition import, Export\[\] exports)  
? System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportSubset(PartManager partManager, IEnumerable\`1 imports, AtomicComposition atomicComposition)  
? System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportsStateMachine(PartManager partManager, ComposablePart part)  
? System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImports(PartManager partManager, ComposablePart part, Boolean shouldTrackImports)  
? System.ComponentModel.Composition.Hosting.ImportEngine.SatisfyImportsOnce(ComposablePart part)  
? System.ComponentModel.Composition.Hosting.CompositionContainer.SatisfyImportsOnce(ComposablePart part)  
? System.ComponentModel.Composition.AttributedModelServices.SatisfyImportsOnce(ICompositionService compositionService, Object attributedPart)  
? Sourcetree.Composition.VSMef.Net471.VSMefCompositionManager.\<Compose\>d__5.MoveNext()


author: Mark Miller
body: I have the same issue/error and SourceTree stopped starting up, even after a system reboot. Any suggestions?

ERROR \[2023-06-14 21:20:43,978\] \[1\] \[Sourcetree.Composition.VSMef.Net48.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 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.Net48.VSMefCompositionManager.\<Compose\>d__5.MoveNext()


author: Mark Miller
body: Uninstalling this Windows update got SourceTree to start properly again:

![sourcetreefix.png](https://community.atlassian.com/t5/image/serverpage/image-id/263329i9C6FE18FFF889F38/image-size/large?v=v2&px=999 "sourcetreefix.png")

Atlassian - can you let us know when you get your software fixed so we can continue moving forward with Windows Updates?


author: vhavard
body: Removing a windows update seems not secure enough

From my side I removed a folder with the name

**C:\\Users\\\<username\>\\AppData\\Local\\Atlassian\\SourceTree.exe_Url_r3nh1lfhtz1f3pkvf1uaijkehygo5m2p**(figures can be different)

and the sourcetree starts again


author: Joao Gueifao
body: I confirm this worked on my Windows 11 as well. I had two folders with that naming. Deleted them both and now it works fine. Thank you. I didn't uninstall any Windows updates.


author: Lars Maxfield
body: Thanks for the solution [@vhavard](/t5/user/viewprofilepage/user-id/804759) --- deleting that second folder worked for me as well.


author: Jon Thompson
body: This did not work for me :( My problem started around the same time. The last time I opened SourceTree was over a month ago. Today it won't open.

After deleting those folders the VS problems in the log have gone away but I still get a Failed to start with a different exception:

```
ERROR [2023-07-02 17:38:54,234] [1] [SourceTree.App] [Log] - Failed to start
System.NullReferenceException: Object reference not set to an instance of an object.
at SourceTree.Host.Bitbucket.BitbucketHost.GetCanonicalUri(IConfigurationManager configurationManager)
at SourceTree.Host.Bitbucket.BitbucketHost.get_CanonicalUri()
at SourceTree.Host.Bitbucket.BitbucketHost.get_CanonicalUrl()
at SourceTree.Accounts.HostedAccount.get_BaseUrl()
at SourceTree.Accounts.LegacyAccountPersistenceService.ConvertFromHostedAccounts(IEnumerable`1 hostedAccounts)
at SourceTree.Accounts.LegacyAccountPersistenceService.LoadAccounts()
at SourceTree.Accounts.AccountManager.LoadHostedAccounts()
at SourceTree.Accounts.AccountManager.get_HostedAccounts()
at SourceTree.Accounts.AccountManager.GetDefaultIdentityAccount()
at SourceTree.UI.ViewModel.Welcome.AtlassianAccountStageViewModel.Activated()
at SourceTree.UI.ViewModel.Welcome.WelcomeWizardWindowViewModel..ctor(IBookmarkManager bookmarkManager, IInteractionsManager interactionsManager, IWebManager webManager, IDispatcher dispatcher, IConfigurationManager configurationManager, IAccountManager accountManager, IRepositoryManager repositoryManager, IDvcsManager dvcsManager, IRepoProcessFactory repoProcessFactory, IDownloadManager downloadManager, IHostManager hostManager, IHostUiManager hostUiManager, INotificationsManager notificationsManager, IEnumerable`1 stages)
at SourceTree.UI.View.Welcome.WelcomeWizardWindow..ctor(IBookmarkManager bookmarkManager, IInteractionsManager interactionsManager, IWebManager webManager, IDispatcher sourceTreeDispatcher, IConfigurationManager configurationManager, IAccountManager accountManager, IRepositoryManager repositoryManager, IDvcsManager dvcsManager, IRepoProcessFactory repoProcessFactory, IDownloadManager downloadManager, IHostManager hostManager, IHostUiManager hostUiManager, INotificationsManager notificationsManager, IEnumerable`1 stages)
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: Joao Gueifao
body: [@Jon Thompson](/t5/user/viewprofilepage/user-id/529028) today I got the same issue again (I hadn't checked the logs to see if the root cause was the same as yours though).

While I was trying to perform the same operation suggested by [@vhavard](/t5/user/viewprofilepage/user-id/804759) above, SourceTree would still not open. Then I restarted Windows, and then it opened fine!


author: Jon Thompson
body: Unfortunately I never solved this. I gave up and migrated to GitHub. They have a tool which can import from BitBucket.