CoreWebView2Environment.CreateOrJoinClusterEnvironmentAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Establishes, or attaches to, a shared WebView2 cluster environment identified by options.ClusterName.
public static System.Threading.Tasks.Task<Microsoft.Web.WebView2.Core.CoreWebView2ClusterEnvironmentCreateResult> CreateOrJoinClusterEnvironmentAsync(Microsoft.Web.WebView2.Core.CoreWebView2ClusterEnvironmentOptions options);
static member CreateOrJoinClusterEnvironmentAsync : Microsoft.Web.WebView2.Core.CoreWebView2ClusterEnvironmentOptions -> System.Threading.Tasks.Task<Microsoft.Web.WebView2.Core.CoreWebView2ClusterEnvironmentCreateResult>
Public Shared Function CreateOrJoinClusterEnvironmentAsync (options As CoreWebView2ClusterEnvironmentOptions) As Task(Of CoreWebView2ClusterEnvironmentCreateResult)
Parameters
The desired options, including the cluster ClusterName. Must not be null.
Returns
Exceptions
WebView2 Runtime installation is missing.
Remarks
A cluster exists only while its browser process is running. The first host to establish a cluster for a given ClusterName fixes its options and starts the shared browser; once that browser exits the next host may establish a different set. Status reports the outcome, and Environment is non-null only when it is Succeeded. OptionsMismatch and NotSupported are outcomes rather than errors and do not throw, so minimal correct usage needs no try/catch. On a mismatch, read the running options with GetClusterEnvironmentOptions(String) and retry, or use a private environment. Throws ArgumentNullException when options is null, and a COMException when the operation cannot be started or fails after starting, including E_INVALIDARG for a missing or invalid ClusterName.