How do I fix SourceTree v3.4.8 not starting up on Windows 11?
Asked by Jaime Benedetty:

Every time I try running SourceTree v3.4.8 the logo modal comes up, disappears, and the application does not run. It appears that its crashing on startup but there are also no event log errors logged. It's also happening when I try to run the app as an administrator.


Answers:
author: Mukesh Kumar
body: Hi [@jackjansen](/t5/user/viewprofilepage/user-id/753076)

<br />

During windows update installation sometimes following cache files get corrupted and cause this issue: Assemblies.cache, Composition.cache  
These files are present at following location: C:\\Users\\\<User\>\\AppData\\Local\\Atlassian\\SourceTree.exe_\<random_string\>\\\<version_number\>

Deleting above 2 files can resolve the issue. Sourcetree will generate these files when you re-run Sourcetree.

Let us know if it works for you.

We have fixed this issue in Sourcetree 3.4.14, which is in beta stage now. GA release of Sourcetree 3.4.14 will be available soon.

[@Ravinandan](/t5/user/viewprofilepage/user-id/5250456) Thanks you for your valuable help.

comments: author: Torben Hermansen
body: Awesome - clean and simple. Thanks, it works!


author: Thanitsak Leuangsupornpong
body: Glad I found this forum, it works! Thanks a bunch!


author: Hailey Porter
body: This worked for me too! Thanks


author: swhittle_gpsl
body: Saved my life! Thanks.


author: johan_vanderwerf2
body: Works like a charm.


author: jackjansen
body: As of this morning (European) I had exactly the same problem on all my Windows 10 machines: the Sourcetree banner screen would flash and then nothing. Task Manager showed that it had indeed crashed. There were crash messages in the logfile but I can't share them because I forgot to save them.  

The fix (which I found here from a probably unrelated thread from years ago):

- Uninstall Sourcetree

- Remove all Sourcetree and Atlassian folders in AppData (they're both in Roaming and Local).

- Reinstall Sourcetree.

But I didn't see [@Ravinandan](/t5/user/viewprofilepage/user-id/5250456) 's message before I did this: that looks like a simpler fix.

comments: author: Ravinandan
body: ```
ERROR [2023-06-20 09:55:44,733] [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()?
```

[@jackjansen](/t5/user/viewprofilepage/user-id/753076) Above is the log for the error , it was due to the latest windows update and seems like it corrupted the Composite file in the .exe file of source tree.


author: jackjansen
body: It turns out that the method of only removing the file in AppData doesn't work for me.

Sourcetree starts up correctly after that, but I'm accessing most repositories with ssh (OpenSSH), and those don't work (complaining about mismatched host keys, and then complaining about my keys not being accepted.

But reinstalling still works.


author: Mukesh Kumar
body: Hi [@Jaime Benedetty](/t5/user/viewprofilepage/user-id/5248900),

Could you please provide the log file which can be found at below path.

**C:\\Users\\\<UserName\>\\AppData\\Local\\Atlassian\\Sourcetree\\sourcetree.log**

Also I would recommend you:

* Uninstall Sourcetree using the Windows Uninstall program if it is available under **Programs and Features**
* .Delete the folders/files below before proceeding to the next step:

<!-- -->

* Navigate to **C:\\Users\\\<UserName\>\\AppData\\Local** and delete all **Sourcetree** folders and files (if any)
* Navigate to **C:\\Users\\\<UserName\>\\AppData\\Local\\Atlassian** and delete all **Sourcetree** folders and files (if any)
* Navigate to **C:\\Users\\\<UserName\>\\AppData\\Roaming\\Atlassian** and delete all **Sourcetree** folders and files (if any)
* Navigate to **C:\\Users\\\<UserName\>\\AppData\\Local\\SourceTree-Settings** and delete all **Sourcetree** folders and files (if any)
* [Download latest version of Sourcetree for Windows](https://www.sourcetreeapp.com/) and install it.
* Now add the user account and clone the repositories.

Let me know if it resolves the issue.

comments: author: Jaime Benedetty
body: If I had pending changes before the issue and before uninstalling it, will I loose all my changes or is there a way for it to detect the update i had made. I have not cloned the repositories yet and I have a copy of the local GIt folder so I'm really hoping that I do not loose my work or hope there is a way to recover my work. please advise.


author: Ravinandan
body: [@Jaime Benedetty](/t5/user/viewprofilepage/user-id/5248900) You don't need to do any of the above steps mentioned by [@Mukesh Kumar](/t5/user/viewprofilepage/user-id/4883692) Just delete the file "\\AppData\\Local\\Atlassian\\SourceTree.exe_Url_hxvn1wpqx4z44hbkwcsdqqsjlvqjpbg2"  

After this just restart Source Tree , all of your data will be there and new file will get restored itself.


author: nathan
body: [@Ravinandan](/t5/user/viewprofilepage/user-id/5250456)'s solution fixed it for me on Windows 11. Thanks!


Tags: atl-gruland