Sourcetree startup error 3.4.9
Asked by ACL:

After upgrading to 3.4.9 multiple users are unable to launch Sourcetree  
The splash screen pops up and disappears.

log file shows:

ERROR \[2022-11-10 14:23:27,694\] \[1\] \[Sourcetree.Composition.VSMef.Net48.CompositionExceptionHelper\] \[Log\] - CompositionException \[Errors occurred during discovery.\]  
ERROR \[2022-11-10 14:23:27,717\] \[1\] \[Sourcetree.Composition.VSMef.Net48.CompositionExceptionHelper\] \[Log\] - Aggregate Exception:  
System.AggregateException: One or more errors occurred. ---\> Microsoft.VisualStudio.Composition.PartDiscoveryException: Failure while scanning type "SourceTree.ViewModel.RepositoryTabContainerViewModel". ---\> System.TypeLoadException: Could not load type 'SourceTree.Api.Analytics.IAnalyticsService' from assembly 'SourceTree.Api.Analytics, Version=3.3.6.3829, Culture=neutral, PublicKeyToken=null'.  
at System.Signature.GetSignature(Void\* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)  
at System.Signature..ctor(IRuntimeFieldInfo fieldHandle, RuntimeType declaringType)  
at System.Reflection.RtFieldInfo.get_FieldType()  
at Microsoft.VisualStudio.Composition.AttributedPartDiscoveryV1.AddImportsFromMembers(PropertyInfo\[\] declaredProperties, FieldInfo\[\] declaredFields, TypeRef partTypeRef, IList\`1 imports)  
at Microsoft.VisualStudio.Composition.AttributedPartDiscoveryV1.CreatePart(Type partType, Boolean typeExplicitlyRequested)  
at Microsoft.VisualStudio.Composition.PartDiscovery.CombinedPartDiscovery.CreatePart(Type partType, Boolean typeExplicitlyRequested)  
at Microsoft.VisualStudio.Composition.PartDiscovery.\<\>c__DisplayClass27_0.\<CreateDiscoveryBlockChain\>b__0(Type type)  
--- End of inner exception stack trace ---  
--- End of inner exception stack trace ---  
---\> (Inner Exception #0) Microsoft.VisualStudio.Composition.PartDiscoveryException: Failure while scanning type "SourceTree.ViewModel.RepositoryTabContainerViewModel". ---\> System.TypeLoadException: Could not load type 'SourceTree.Api.Analytics.IAnalyticsService' from assembly 'SourceTree.Api.Analytics, Version=3.3.6.3829, Culture=neutral, PublicKeyToken=null'.  
at System.Signature.GetSignature(Void\* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)  
at System.Signature..ctor(IRuntimeFieldInfo fieldHandle, RuntimeType declaringType)  
at System.Reflection.RtFieldInfo.get_FieldType()  
at Microsoft.VisualStudio.Composition.AttributedPartDiscoveryV1.AddImportsFromMembers(PropertyInfo\[\] declaredProperties, FieldInfo\[\] declaredFields, TypeRef partTypeRef, IList\`1 imports)  
at Microsoft.VisualStudio.Composition.AttributedPartDiscoveryV1.CreatePart(Type partType, Boolean typeExplicitlyRequested)  
at Microsoft.VisualStudio.Composition.PartDiscovery.CombinedPartDiscovery.CreatePart(Type partType, Boolean typeExplicitlyRequested)  
at Microsoft.VisualStudio.Composition.PartDiscovery.\<\>c__DisplayClass27_0.\<CreateDiscoveryBlockChain\>b__0(Type type)  
--- End of inner exception stack trace ---\<---

ERROR \[2022-11-10 14:23:27,724\] \[1\] \[Sourcetree.Composition.VSMef.Net48.CompositionExceptionHelper\] \[Log\] - PartDiscoveryException:  
Microsoft.VisualStudio.Composition.PartDiscoveryException: Failure while scanning type "SourceTree.ViewModel.RepositoryTabContainerViewModel". ---\> System.TypeLoadException: Could not load type 'SourceTree.Api.Analytics.IAnalyticsService' from assembly 'SourceTree.Api.Analytics, Version=3.3.6.3829, Culture=neutral, PublicKeyToken=null'.  
at System.Signature.GetSignature(Void\* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)  
at System.Signature..ctor(IRuntimeFieldInfo fieldHandle, RuntimeType declaringType)  
at System.Reflection.RtFieldInfo.get_FieldType()  
at Microsoft.VisualStudio.Composition.AttributedPartDiscoveryV1.AddImportsFromMembers(PropertyInfo\[\] declaredProperties, FieldInfo\[\] declaredFields, TypeRef partTypeRef, IList\`1 imports)  
at Microsoft.VisualStudio.Composition.AttributedPartDiscoveryV1.CreatePart(Type partType, Boolean typeExplicitlyRequested)  
at Microsoft.VisualStudio.Composition.PartDiscovery.CombinedPartDiscovery.CreatePart(Type partType, Boolean typeExplicitlyRequested)  
at Microsoft.VisualStudio.Composition.PartDiscovery.\<\>c__DisplayClass27_0.\<CreateDiscoveryBlockChain\>b__0(Type type)  
--- End of inner exception stack trace ---

Has anyone seen this before or have any ideas please? thanks!


Answers:
author: ACL
body: Managed to fix - the issue was being caused by upgrading from a previous version to the new one.

So manually deleted the sourcetree install folder and then installing the new one works.