Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console Debug to find errors #16

Closed
digitaico opened this issue May 30, 2017 · 6 comments
Closed

Console Debug to find errors #16

digitaico opened this issue May 30, 2017 · 6 comments
Labels

Comments

@digitaico
Copy link

I've followed the class documentation and even some guides found on the web. However, when loading my c# wpf app, there is no update dialog. I want to know if there is a method to print on console, any errors. Thanks.

@ravibpatel
Copy link
Owner

did you try handling the update logic yourself by subscribing to CheckForUpdateEvent? You can do it like this.

AutoUpdater.CheckForUpdateEvent += AutoUpdaterOnCheckForUpdateEvent;

private void AutoUpdaterOnCheckForUpdateEvent(UpdateInfoEventArgs args)
{
    if (args != null)
    {
        if (args.IsUpdateAvailable)
        {
            var dialogResult =
                MessageBox.Show(
                    string.Format(
                        "There is new version {0} available. You are using version {1}. Do you want to update the application now?",
                        args.CurrentVersion, args.InstalledVersion), @"Update Available",
                    MessageBoxButtons.YesNo,
                    MessageBoxIcon.Information);

            if (dialogResult.Equals(DialogResult.Yes))
            {
                try
                {
                    //You can use Download Update dialog used by AutoUpdater.NET to download the update.

                    AutoUpdater.DownloadUpdate();
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.Message, exception.GetType().ToString(), MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
                }
            }
        }
        else
        {
            MessageBox.Show(@"There is no update available please try again later.", @"No update available",
                MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
    }
    else
    {
        MessageBox.Show(
                @"There is a problem reaching update server please check your internet connection and try again later.",
                @"Update check failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
    }
}

@ravibpatel
Copy link
Owner

did above solution fix your issue?

@ravibpatel
Copy link
Owner

Now you can set ReportErrors to true and it will show you the errors.

@digitaico
Copy link
Author

Hi @ravibpatel thanks for your answer, I indeed used ReportErrors, however the class is working fine so no errors reported, thanks again for sharing.

@lucahost
Copy link

Now you can set ReportErrors to true and it will show you the errors.

Does it also show errors even when the UpdateInfoEventArgs is null?
If so, where does it show those?

@ravibpatel
Copy link
Owner

Yes, It will show error when UpdateInfoEventArgs is null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants