简体   繁体   中英

Squirrell UpdateManager CheckForUpdate hangs - no logging

The following line hangs forever.

  updateInfo = await mgr.CheckForUpdate();

I'm guessing it has something to do with acquiring a lock on a file? It's hard to diagnose without enabling logging. I was not able to enable logging per these instructions. If I register a logger in my program as in either of the below lines of code, nothing is logged. I'm guessing because the context of the program is different from the context of the update.exe.

  Splat.Locator.CurrentMutable.Register(() => myLogger, typeof(Splat.ILogger));
  Splat.Locator.CurrentMutable.Register(() => myLogger2, typeof(Splat.IFullLogger));
            

Any help diagnosing the check-update or forcing the log would be appreciated

It's a know bug: CheckForUpdate() doesn't return

It's the WebClient that deadlock when call from the main thread. The solution is to call Squirrel from a other thread, like:

static async Task CheckForUpdateSafe(this UpdateManager mgr)
{
    await Task.Run(async () =>
    {
        await mgr.CheckForUpdate()
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM