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

Microsoft.Web.Webview2 latest version breaks auto updater #547

Closed
bokspro opened this issue Jul 7, 2022 · 5 comments
Closed

Microsoft.Web.Webview2 latest version breaks auto updater #547

bokspro opened this issue Jul 7, 2022 · 5 comments

Comments

@bokspro
Copy link
Contributor

bokspro commented Jul 7, 2022

If I update Microsoft.Web.Webview2 to version 1.0.1264.42(Latest version) I get exception when I start auto updater:
Method not found: 'System.Threading.Tasks.Task Microsoft.Web.WebView2.WinForms.WebView2.EnsureCoreWebView2Async(Microsoft.Web.WebView2.Core.CoreWebView2Environment)'.
Stack trace:

   at AutoUpdaterDotNET.UpdateForm.InitializeBrowserControl()
   at AutoUpdaterDotNET.UpdateForm..ctor(UpdateInfoEventArgs args) in c:\projects\AutoUpdater.NET\AutoUpdater.NET\UpdateForm.cs:line 20
   at AutoUpdaterDotNET.AutoUpdater.ShowUpdateForm(UpdateInfoEventArgs args) in c:\projects\AutoUpdater.NET\AutoUpdater.NET\AutoUpdater.cs:line 657
   at AutoUpdaterDotNET.AutoUpdater.StartUpdate(Object result) in c:\projects\AutoUpdater.NET\AutoUpdater.NET\AutoUpdater.cs:line 468
   at AutoUpdaterDotNET.AutoUpdater.<>c.<Start>b__43_1(Object _, RunWorkerCompletedEventArgs args) in c:\projects\AutoUpdater.NET\AutoUpdater.NET\AutoUpdater.cs:line 329
   at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
   at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(Object arg)

But downgrading to Microsoft.Web.Webview2 version 1.0.1245.22 fixes the issue.
My project is .Net framework 4.8 windows forms.
This is how I start auto updater:

public void CheckUpdates()
        {
            string UpdatePath =  @"\\my-server\update.xml";
            AutoUpdater.Synchronous = false;
            AutoUpdater.RunUpdateAsAdmin = false;
            AutoUpdater.Mandatory = false;
            AutoUpdater.Start(UpdatePath);
        }

update.xml contents:

<?xml version='1.0' encoding='UTF-8'?>
<item>
    <version>2.0.136.81</version>
    <url>\\my-server\update.zip</url>
    <mandatory>true</mandatory>
</item>

To replicate the issue, I created a simple .Net Framework 4.8 windows forms project, added AutoUpdater.NET through nugget, and updated Microsoft.Web.Webview2 to the latest version
autoupdater_test.zip
:

@bokspro bokspro changed the title Microsoft.Web.Webview2 newest version breaks auto updater Microsoft.Web.Webview2 latest version breaks auto updater Jul 7, 2022
@TrucksLOG
Copy link

Dito

@TrucksLOG
Copy link

TrucksLOG commented Jul 8, 2022

Remove the changelog entry from your XAML file, then WebView should no longer be displayed. I still have AutoUpdater.UpdateMode = Mode.ForcedDownload;
AutoUpdater.Synchronous = true;
turned on, we do it that way

@ravibpatel
Copy link
Owner

I am investigating the issue. I will post an update once I find the solution.

@ravibpatel
Copy link
Owner

I managed to fix the issue in the latest commit. Can you check it out by manually referencing the DLL from here?

@bokspro
Copy link
Contributor Author

bokspro commented Jul 11, 2022

I managed to fix the issue in the latest commit. Can you check it out by manually referencing the DLL from here?

Thank you, this commit fixed the issue for me!

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

No branches or pull requests

3 participants