Uploaded image for project: 'Sourcetree for Windows'
  1. Sourcetree for Windows
  2. SRCTREEWIN-7904

SourceTree failes to start (NullReferenceException in stack trace)

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: High High
    • None
    • 2.3.1.0
    • None
    • Windows 10, Version 1703, x64, Russian

    • Severity 2 - Major

      Symptoms: when I start SourceTree nothing happens. Process sourcetree.exe is created and closed in 2 seconds.

      StackTrace in log:

      ERROR [2017-09-14 12:42:05,554] [1] [SourceTree.App] [.ctor] - finish EnsureSquirrelExecutionStubIsCopied
      ERROR [2017-09-14 12:42:05,761] [1] [SourceTree.App] [OnStartup] - Failed to start
      System.NullReferenceException: Object reference not set to an instance of an object.
         at SourceTree.Notifications.NotificationsManager.SetOwner(NotificationDialogWindow notificationWindow)
         at SourceTree.Notifications.NotificationsManager.ShowNotificationDialog[T](NotificationDialogWindow notificationWindow, Tuple`2 customAction, VistaTaskDialogIcon icon)
         at SourceTree.Notifications.NotificationsManager.ShowNotificationDialog[T](String title, String message, Tuple`2 customAction, String cancelLabel, String suppressionSetting, Action`1 suppressionChangedAction, Object contentControl, String contentCommandLabel, Action contentAction)
         at SourceTree.Notifications.NotificationsManager.ShowNotificationDialogWithYesConfirmation(String title, String message, String details)
         at SourceTree.Configuration.WpfSpellCheckerPreFlightCheck.Run()
         at SourceTree.AppRoot.RunPreFlightChecks()
         at SourceTree.AppRoot.OnStartup(StartupEventArgs e)
         at SourceTree.App.OnStartup(StartupEventArgs e)
      

        1. sourcetree.log
          2 kB
        2. sourcetree.png
          sourcetree.png
          10 kB

            [SRCTREEWIN-7904] SourceTree failes to start (NullReferenceException in stack trace)

            minnsey added a comment -

            Hi Thomas,

            Sourcetree just flags up entries from the registry that do not exist, I think if you check you should find that they do not exist on the filesystem.
            The presence of these entries can have a significant performance effect on WPF textboxes that allow spell checking, hence the check. You can choose not to delete them.

            minnsey added a comment - Hi Thomas, Sourcetree just flags up entries from the registry that do not exist, I think if you check you should find that they do not exist on the filesystem. The presence of these entries can have a significant performance effect on WPF textboxes that allow spell checking, hence the check. You can choose not to delete them.

            This is the warning I get each time when starting Sourcetree (currently back on version 2.1.10.0). Why does Sourcetree interfer with Office?

            Deleted Account (Inactive) added a comment - This is the warning I get each time when starting Sourcetree (currently back on version 2.1.10.0). Why does Sourcetree interfer with Office?

            minnsey added a comment -

            thomas.decraemer thanks for the information.

            We have a fix in progress for the notification dialog. However the process should only delete references from the registry, references to files that do not actually exist. Sourcetree does not actually delete any files

            https://stackoverflow.com/questions/37264673/spelling-with-textboxes-and-custom-dictionaries-slowing-down-my-application-in-c

            minnsey added a comment - thomas.decraemer thanks for the information. We have a fix in progress for the notification dialog. However the process should only delete references from the registry, references to files that do not actually exist. Sourcetree does not actually delete any files https://stackoverflow.com/questions/37264673/spelling-with-textboxes-and-custom-dictionaries-slowing-down-my-application-in-c

            Bobby Tait added a comment -

            Same issue for me. And Meraj's work-around worked for me also.

            Bobby Tait added a comment - Same issue for me. And Meraj's work-around worked for me also.

            I'm afraid I can't do the AutomaticallyCleanUpDictionaryFiles since sourcetree detects the dictionary files of my outlook client and tries to delete them. This in turn makes my Outlook crash...

            I'm reverting to 2.1.10.0 in the meantime.

            Deleted Account (Inactive) added a comment - I'm afraid I can't do the AutomaticallyCleanUpDictionaryFiles since sourcetree detects the dictionary files of my outlook client and tries to delete them. This in turn makes my Outlook crash... I'm reverting to 2.1.10.0 in the meantime.

            ccenvcvb added a comment -

            Had the same in my environment, the work-around of adding AutomaticallyCleanUpDictionaryFiles to user.config did help.

            After chaning the setting I got some dialogs during startup that closed immediately before I could read them.

            After that a warning about outdated Mercurial that remained visible,

            in the end Sourcetree started.

            ccenvcvb added a comment - Had the same in my environment, the work-around of adding AutomaticallyCleanUpDictionaryFiles to user.config did help. After chaning the setting I got some dialogs during startup that closed immediately before I could read them. After that a warning about outdated Mercurial that remained visible, in the end Sourcetree started.

            minnsey added a comment -

            The issue seems to be Sourcetree is trying to display a warning dialog before the main window is available.

            I suspect meraj.ahmed's workaround is working because it effectively resets the whole configuration.

            A potential workaround is to set the following value in the user.config at %localappdata%\Atlassian\Sourcetree.exe_url_{hash}\2.3.1.0\user.config

                        <setting name="AutomaticallyCleanUpDictionaryFiles" serializeAs="String">
                            <value>True</value>
                        </setting>

             

             

            This should disable the notification that is trying to appear.

            minnsey added a comment - The issue seems to be Sourcetree is trying to display a warning dialog before the main window is available. I suspect meraj.ahmed 's workaround is working because it effectively resets the whole configuration. A potential workaround is to set the following value in the user.config at %localappdata%\Atlassian\Sourcetree.exe_url_{hash}\2.3.1.0\user.config             <setting name="AutomaticallyCleanUpDictionaryFiles" serializeAs="String">                 <value>True</value>             </setting>     This should disable the notification that is trying to appear.

            Ok, this is strange. I downloaded and installed the current version available from the website again (2.1.11), then I was able to open it. I clicked on the update notification and let it update to the latest version again (2.3.1), then closed and opened and everything worked fine. So try that and see if it works for you.

            Meraj Ahmed added a comment - Ok, this is strange. I downloaded and installed the current version available from the website again (2.1.11), then I was able to open it. I clicked on the update notification and let it update to the latest version again (2.3.1), then closed and opened and everything worked fine. So try that and see if it works for you.

            Same here. Even if I try to directly run %LOCALAPPDATA%/SourceTree/app-2.3.1/SourceTree.exe or even the older version that's there, %LOCALAPPDATA%/SourceTree/app-2.2.4/SourceTree.exe, neither will launch.

            Meraj Ahmed added a comment - Same here. Even if I try to directly run %LOCALAPPDATA%/SourceTree/app-2.3.1/SourceTree.exe or even the older version that's there, %LOCALAPPDATA%/SourceTree/app-2.2.4/SourceTree.exe , neither will launch.

            I am also having exactly the same issue!

            nsoonhui_mes added a comment - I am also having exactly the same issue!

              Unassigned Unassigned
              47868b3d11ed Sergey Kozyr
              Affected customers:
              7 This affects my team
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: