Evergreen Webview2 -
In your installer (MSI or ClickOnce), include the Bootstrapper link:
// MainWindow.xaml.cs public async void InitializeWebView() { // Notice: No path specified. The runtime will find the Evergreen runtime. var env = await CoreWebView2Environment.CreateAsync(); await webView.EnsureCoreWebView2Async(env); // Navigate to your local or remote app webView.CoreWebView2.Navigate("https://my-saas-dashboard.com"); } evergreen webview2
Enter the . This is not just a distribution model; it is a philosophical shift in how Windows maintains, updates, and secures its web rendering ecosystem. In this deep-dive, we will explore why the Evergreen model is the default standard for modern Windows development, how it works under the hood, and why your next desktop app should adopt it immediately. Part 1: What is "Evergreen" in Software Terms? Before understanding the WebView2, we must understand the adjective "Evergreen." In your installer (MSI or ClickOnce), include the
Then came WebView2. Microsoft’s answer to native embedding of modern web technologies seemed perfect—until developers hit the distribution problem . Should you ship the fixed, 200MB "Fixed Version" runtime with your app? Or ask your user to download the "Bootstrapper"? This is not just a distribution model; it
CoreWebView2Environment? env = null; try { env = await CoreWebView2Environment.CreateAsync(); } catch (WebView2RuntimeNotFoundException) { // Fallback to a fixed version you bundled in a subfolder env = await CoreWebView2Environment.CreateAsync( browserExecutableFolder: "./FixedWebView2/" ); } Evergreen does not prevent you from isolating profiles. For a multi-tenant app, you can launch different WebView2 instances with different user data folders, leveraging the same shared runtime binaries.
<!-- MainWindow.xaml --> <Window xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"> <Grid> <wv2:WebView2 x:Name="webView" /> </Grid> </Window>