NetSparkle: Checking for new version crashes program

I’m using WPF with .net core 3.1 and NetSparkleUpdater.UI.WPF version 2.0.0-preview20200628002. When I manually check for updates with CheckForUpdatesAtUserRequest(); my app crashes hard (Trying to open the visual studio just in time debugger doesn’t work / the WPF DispatcherUnhandledException event doesn’t fire). I initialize the sparkle object with the below code:

sparkle = new SparkleUpdater(
                    "https://domain.com/Appcast/appcast.xml",
                    new Ed25519Checker(SecurityMode.Strict,
                        "base 64 private key") 
                ) {
                    UIFactory = new NetSparkleUpdater.UI.WPF.UIFactory(null)
                };
                sparkle.StartLoop(true)

Do you know what could cause this problem?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16

Most upvoted comments

I was running into the exact same errors using NetSparkle with WPF. Turns out the problem was I was creating SparkleUpdater before calling App.Run(). SparkleUpdater’s constructor will store SynchronizationContext.Current, however at that point it won’t be properly initialized to WPF’s SynchronizationContext.

Maybe this could help someone in the future.

Sorry for not responding. I no longer work at the company where the bug happened, so I no longer have access to the code. Sorry I couldn’t be more helpful.