Skip to content

[Feature]: Runtime Compatibility Check #5267

Open
@TrendyTim

Description

@TrendyTim

Describe the feature/enhancement you need

I recently came across a client where i was getting

Unable to cast COM object of type 'System.ComObject' to interface type
'Microsoft.Web.WebView2.Core.Raw.ICoreWebView2_13'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{F75F09A8-667E-4983-88D6-C8773F315E84}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

I already check CoreWebView2Environment.GetAvailableBrowserVersionString to see if its installed, and it passed (no idea which version it was at though).

The problem was resolved by installing a newer version of the runtime, i have added a call to CompareBrowserVersions passing it an arbitrary version (120.0) to prevent relapse but it would be infinitely better if we had an api of just IsCompatibleRuntimeInstalled (would remove the need to ensure that is kept upto date) , id have thought by now pretty much everyone would have the evergreen runtime installed (or none at all) but it seems not.

The scenario/use case where you would use this feature

Would call this on app startup to ensure that the proper runtime is installed, and initiate download and install if its not.

How important is this request to you?

Nice to have. There are other ways to tackle this, but having official API support would be beneficial.

Suggested implementation

A method like CoreWebView2Environment.IsCompatibleRuntimeInstalled which would check an internal min version required (and any other required checks to ensure it can run ok, without us having to resort to creating a dummy form with webview and navigating to ensure it works.

I'd even settle for a CoreWebView2Environment.MinimumRequiredVersion though the IsCompatibleRuntimeInstalled would give more flexibility for you down the track if needed, or a CompatabilityCheck method that returned various diagnostics (incompatible OS, runtime too old, etc)

What does your app do? Is there a pending deadline for this request?

No response

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions