"Cannot set Owner property to a Window that has not been shown previously." whenever I try to open
Asked by MrShmid:

I can't open SourceTree. Everytime I try to run it nothing happens. It shows up in the Task Manager for a few seconds before disappearing. I get this error in the log every time:

```
ERROR [2017-08-01 13:26:01,530] [1] [SourceTree.App] [OnStartup] - Failed to start
System.InvalidOperationException: Cannot set Owner property to a Window that has not been shown previously.
 at System.Windows.Window.set_Owner(Window value)
 at SourceTree.Notifications.NotificationsManager.ShowNotificationDialog[T](NotificationDialogWindow notificationWindow, Tuple`2 customAction, VistaTaskDialogIcon icon)
 at SourceTree.Repo.RepoHandlerGitOld.CheckLargeFilesInstalled(Boolean fixAndpromptUser)
 at SourceTree.Repo.RepoHandlerGitOld.CheckIfGitLfsRequiredForRepo(String path, Boolean fixAndpromptUser)
 at SourceTree.Repo.RepoHandlerGitOld.CheckConfigForRepo(String path, Boolean fixAndpromptUser)
 at SourceTree.ViewModel.RepositoryTabContainerViewModel.AddNew(String path, Boolean wasCloned, RepoViewMode atView, String viewData)
 at SourceTree.ViewModel.RepositoryTabContainerViewModel.AddOrActivate(String path, RepoViewMode atView, String viewData)
 at SourceTree.ViewModel.RepositoryTabContainerViewModel.OpenRepoInTab(String path, RepoViewMode atView, String viewData)
 at SourceTree.AppRoot.SingleInstanceOpenRepo(Boolean isFirstInstance, String targetRepo, RepoViewMode view, String data)
 at SourceTree.AppRoot.ProcessArguments(Boolean isFirstInstance)
 at SourceTree.AppRoot.DoWindowStartupTasks()
 at SourceTree.ViewModel.MainWindowViewModel..ctor(IRepositoryTabContainerViewModel repositoryTabContainerViewModel, ICustomActionsManager customActionsManager, IRepositoryManager repositoryManager, IAnalyticsDataManager analyticsDataManager, ITraceManager traceManager, IDispatcher dispatcher, IAccountManager accountManager, IFailureHandler failureHandler, IDvcsManager dvcsManager, IConfigurationManager configurationManager, IInstanceManager instanceManager, ISchedulerManager schedulerManager, IWebManager webManager, IRepositoryMonitorManager repositoryMonitorManager, ISshKeyManager sshKeyManager, INotificationsManager notificationsManager, IPreferencesManager preferencesManager)
 at SourceTree.MainWindow..ctor(IRepositoryTabContainerViewModel repositoryTabContainerViewModel, ICustomActionsManager customActionsManager, IRepositoryManager repositoryManager, IAnalyticsDataManager analyticsDataManager, ITraceManager traceManager, IDispatcher dispatcher, IAccountManager accountManager, IFailureHandler failureHandler, IDvcsManager dvcsManager, IConfigurationManager configurationManager, IInstanceManager instanceManager, ISchedulerManager schedulerManager, IWebManager webManager, IRepositoryMonitorManager repositoryMonitorManager, IApplicationManager applicationManager, ISshKeyManager sshKeyManager, INotificationsManager notificationsManager, IBookmarkManager bookmarkManager, IPreferencesManager preferencesManager)
 at SourceTree.AppRoot.OnStartup(StartupEventArgs e)
 at SourceTree.App.OnStartup(StartupEventArgs e)
```

I've tried reinstalling, manually deleting the Atlassian AppData, and running as an administrator. Same results.

What's going on here?


Answers:
author: MrShmid
body: If I run the installer after SourceTree has been installed, it loads up and works fine.


author: Ana Retamal
body: Hi, looks like you're affected by the bug [SRCTREEWIN-7373](https://jira.atlassian.com/browse/SRCTREEWIN-7373).

To solve this, download and install the latest Git-LFS version from <https://git-lfs.github.com/>. This will re-install Git-LFS and should ensure SourceTree can find it.

Let us know if this worked for you!

Cheers,

Ana

comments: author: MrShmid
body: I tried doing that and got the same result. I tried reinstalling SourceTree and it loaded after installation, but I was unable to open it again.


author: MrShmid
body: I found something weird:

If I run the installer when SourceTree has already been installed, it loads up fine. If I try to open it through a shortcut or running the application directly, it doesn't work.


author: fernando gandini
body: I have the same weird behavior!


Tags: crash

error

windows