await CoreWebView2Environment.CreateAsync( browserExecutableFolder: null, // null = use Evergreen system runtime userDataFolder: "C:\\AppData\\MyApp\\WebView2", options: new CoreWebView2EnvironmentOptions() );
// Check runtime availability string version = CoreWebView2Environment.GetAvailableBrowserVersionString(); if (version == null) // Launch bootstrapper from https://go.microsoft.com/fwlink/p/?LinkId=2124703 var installer = new WebView2RuntimeInstaller(); await installer.InstallEvergreenRuntimeAsync();
The Evergreen runtime is located automatically by the WebView2 loader. evergreen webview2
Since the runtime updates automatically, your app can leverage the latest JavaScript features, CSS grid improvements, or WebAssembly optimizations without a code change.
This allows you to bundle a specific, frozen version of WebView2 inside your app's installation folder. await CoreWebView2Environment
While Evergreen is the default and recommended approach for 95% of apps, it introduces environment variability.
If your app relies on a very specific JavaScript behavior or a newly introduced API, User A might experience a bug that User B does not. The Evergreen runtime is located automatically by the
The Solution: For enterprise apps that require absolute consistency (e.g., kiosk systems, strictly regulated industries), Microsoft offers the "Fixed Version" distribution mode. This allows you to package a specific version of the WebView2 Runtime inside your app, freezing it in time. This sacrifices the benefits of auto-updating in exchange for stability.