
Developing and deploying WebView2 requires careful planning to ensure a smooth experience for both developers and users.
To start, make sure to use the latest version of the WebView2 SDK, which is available on GitHub. This will ensure you have access to the latest features and bug fixes.
When creating a WebView2 application, consider using a sandboxed instance to isolate the web content from the rest of the application. This can help prevent security issues and improve overall stability.
Keep in mind that WebView2 is not a full-fledged browser, so it's essential to understand its limitations and capabilities before development.
By following these best practices, you can create a high-quality WebView2 application that meets the needs of your users.
Benefits and Features
WebView2 offers a wealth of benefits and features that make it an attractive choice for developers.
You can take advantage of the full web platform, libraries, tools, and skilled developers already available in the web ecosystem. This allows for rapid innovation, with faster deployment and updates, enabling you to improve your app faster.
WebView2 works consistently across both Windows 10 and Windows 11, providing a smooth user experience. You can also access all Native APIs to integrate native features within your app.
Here are some of the key benefits of WebView2:
- Web Ecosystem and Skills: Access to the full web platform, libraries, tools, and skilled developers.
- Faster Innovation: Quicker deployment and updates for improved app performance.
- Native Capabilities: Access to all Native APIs for seamless integration.
- Code Sharing: Reuse web code across multiple platforms for increased efficiency.
- Microsoft Support: Official support and feature requests on supported platforms.
- Evergreen Distribution: Latest version of Chromium with regular updates and security patches.
- Fixed Version Distribution: Option to package a specific version of Chromium in your app.
- Incremental Adoption: Gradual addition of web components to your app.
With WebView2, you can rely on Microsoft's support and updates, ensuring your app stays secure and up-to-date.
Browser Features
Browser Features are an essential part of any web browser, and WebView2 is no exception. Here are some of the key features you can expect to find.
Autofill for Addresses is turned on by default, but you can turn it off or on using the WebView2 Autofill APIs. This feature is designed to save you time by automatically filling in address fields.
Downloads are another important feature in WebView2, and they're turned on by default. You can customize the download UI to manipulate downloads using the WebView2 APIs.
Some features, like Autofill for Passwords, are turned off by default, but can be turned on or off using the WebView2 Autofill APIs. This feature is designed to protect your password security.
For more insights, see: Microsoft Edge Webview2 Using Memory

Smart Screen is turned on by default, but the UI for this feature has been removed. However, the underlying functionality is still available. You can also turn off Smart Screen by using a command-line switch.
Tracking Prevention is turned on by default, but the UI for this feature has been removed. The underlying functionality is still available, and Tracking Prevention is always set to balanced.
Here's a summary of the default state of some of the key features in WebView2:
Web Platform Features
WebView2 has some limitations when it comes to web platform features. Evergreen mode requires feature-detecting to ensure the client's machine supports the latest WebView2 Runtime APIs.
Updates to the WebView2 Runtime might not occur if an IT Admin disables updating or the client is offline. You can check for the presence of new APIs using methods like QueryInterface or try-catch.
The following WebView2 platform features are currently unavailable:
Note that disabling updates for Microsoft Edge doesn't impact the availability of the latest WebView2 APIs, as the WebView2 Runtime can still update automatically unless updating is disabled by an Admin.
Supported Environments and Devices

WebView2 is supported on a variety of programming environments and devices.
The following programming environments are supported: Win32 C/C++, .NET Framework 4.6.2 or later, .NET Core 3.1 or later, .NET 5 or later, WinUI 2.0, and WinUI 3.0.
WebView2 can run on Windows 11, Windows 10, and various Windows Server versions, including Windows Server 2022, Windows Server 2019, and Windows Server 2016.
In addition to Windows devices, WebView2 is also supported on Xbox and HoloLens 2.
Here's a breakdown of the supported programming environments:
- Win32 C/C++
- .NET Framework 4.6.2 or later
- .NET Core 3.1 or later
- .NET 5 or later
- WinUI 2.0
- WinUI 3.0
And here's a list of supported Windows versions:
- Windows 11
- Windows 10
- Windows 10 IoT Enterprise LTSC x32 2019
- Windows 10 IoT Enterprise LTSC x64 2019
- Windows 10 IoT Enterprise 21h1 x64
- Windows Server 2022
- Windows Server 2019
- Windows Server 2016
Development and Deployment
When developing a WebView2 app, you have two options for the backing web platform: the WebView2 Runtime or a preview Microsoft Edge browser channel. The WebView2 Runtime provides the same web platform capabilities and update cadence as the Stable channel of the Microsoft Edge browser.
You can use the WebView2 Runtime in a production environment or to develop and test against the web platform that your users have today. This approach is recommended because the WebView2 Runtime is developed and tested for app scenarios, and it might include bug fixes that aren't yet available in the browser.
A production release of a WebView2 app can only use the WebView2 Runtime as the backing web platform, not Microsoft Edge. This restriction prevents a production release of a WebView2 app from taking a dependency on the browser.
You should check whether the WebView2 Runtime is present on the client before creating a WebView2, and install the Runtime if it is missing. You can do this check when installing or updating your app, or at app runtime.
Hybrid App Approach
When deciding between building a web app or a native app, developers must consider the tradeoff between reach and power. Web apps offer broad reach, allowing you to reuse most of your code across different platforms.
Developers can choose from a spectrum of apps, ranging from maximum reach to maximum power. Here's a breakdown of the options:
Hybrid apps, such as WebViews and Electron, allow you to enjoy the best of both worlds: the ubiquity and strength of the web platform combined with the power and full capabilities of the native platform.
Developers' Key Considerations

Working with WebView2 requires familiarity with its specific APIs and functionalities, which can be a significant learning curve, especially for those with a background in traditional web development.
Embedding web content introduces potential security vulnerabilities that developers need to address using strong security practices to reduce these risks.
The performance of web content within WebView2 can be impacted by factors like complex web code and resource limitations, requiring optimization strategies to ensure smooth operation.
Debugging issues within WebView2 can be more challenging than traditional web development due to the integration with the native application, requiring additional steps to resolve issues.
Deployment Options
The WebView2 Runtime is the recommended approach for production environments, ensuring users have the latest and most secure version of the WebView2 engine.
You can deploy the WebView2 Runtime using various tools, including the WebView2 Runtime Bootstrapper, which is a tiny installer that downloads and installs the Evergreen Runtime from Microsoft servers.
For offline clients, the WebView2 Runtime Standalone Installer is a full installer that installs the Evergreen WebView2 Runtime in offline environments.
You can also specify the WebView2 Runtime as a dependency in App Installer to have it installed with the application.
Here are the deployment options for developers:
The Evergreen distribution mode is recommended for most apps, and you can use the Evergreen Bootstrapper or the Evergreen Standalone Installer to deploy the WebView2 Runtime.
The Fixed Version section of the page provides a Fixed Version runtime, which is a specific version of the WebView2 Runtime that you distribute along with your app.
Testing and Debugging
To avoid interference between multiple test instances, set the WEBVIEW2_USER_DATA_FOLDER environment variable to a different folder for each test.
You can also use the WebView2.EnsureCoreWebView2Async Method to achieve this.
For debugging, you can right-click inside your webview2 control and select "Inspect" to open the DevTools, or press F12.
Alternatively, you can use the WebView2.CoreWebView2.OpenDevToolsWindow method to open the DevTools programmatically.
Testing
To avoid interfering with each other, run multiple tests in parallel by setting the WEBVIEW2_USER_DATA_FOLDER environment variable to a different folder for each test.
This will ensure that each test runs in its own user data directory, preventing conflicts and making your testing process more reliable.
In the Evergreen distribution mode, the WebView2 Runtime is automatically kept up to date on the client to provide the latest features and security fixes, so it's essential to set up testing infrastructure to ensure your app stays compatible with the web.
For best practices on how to test your app for forward-compatibility, see Prerelease testing using preview channels and Self-host by deploying preview channels.
To feature-detect when using recent APIs in WebView2 apps, use methods like QueryInterface or try-catch to check for the presence of new APIs on the client's machine.
Updates to the WebView2 Runtime might not occur if an IT Admin disables updating, or if the client is offline, so it's crucial to consider these scenarios when testing your app's forward-compatibility.
Debugging
Debugging is a crucial part of the testing process. You can open the DevTools by right-clicking inside your webview2 control and selecting "Inspect" from the context menu, or by pressing F12.
Using the DevTools allows you to inspect and debug your web application. The WebView2.CoreWebView2.OpenDevToolsWindow method can also be used to open the DevTools programmatically.
For more advanced debugging, consider using the Playwright Debugging guide, specifically designed for debugging tests.
Installation and Updates
You can install the Evergreen WebView2 Runtime using the WebView2 Runtime Bootstrapper, which is a tiny installer that downloads and installs the Evergreen Runtime from Microsoft servers that match the user's device architecture.
For offline clients, you can use the WebView2 Runtime Standalone Installer, which is a full installer that installs the Evergreen WebView2 Runtime in offline environments.
You can also specify the WebView2 Runtime as a dependency in your App package manifest using App Installer, which will have it installed with the application.
To update the Evergreen WebView2 Runtime, new versions are automatically downloaded to the client, but your app will continue to use the previous version until it's restarted. You can have an event handler for the NewBrowserVersionAvailable event to notify the user to restart the app.
Alternatively, you can use the Fixed Version distribution mode, where you download a specific version of the WebView2 Runtime and package it together with your app, which will use the specified version of the WebView2 Runtime.
Here are the tools available for deploying the Evergreen WebView2 Runtime:
- WebView2 Runtime Bootstrapper: a tiny installer for online clients
- WebView2 Runtime Standalone Installer: a full installer for offline clients
- App Installer: can specify the WebView2 Runtime as a dependency
Installing per-machine or per-user
When you're installing an application, you have the option to choose whether it's installed per-machine or per-user.
Per-machine installations are system-wide and affect all users on the system.
This type of installation is commonly used for system tools and software that require administrative privileges.
Per-user installations, on the other hand, are user-specific and only affect the user who installed the application.
Broaden your view: Webview2 Runtime Is Not Installed in Your Os

This type of installation is commonly used for applications that require user-specific data and settings.
For example, Microsoft Office is installed per-user by default, allowing each user to have their own copy of the application.
This is in contrast to system-wide tools like Adobe Acrobat, which is installed per-machine.
The choice between per-machine and per-user installation depends on the application's requirements and the user's needs.
Fixed Version Distribution
The Fixed Version distribution mode is a great option for developers who need more control over the WebView2 Runtime version used by their app. You get to decide which version of the Runtime is available to your app, giving you full control over which APIs are accessible.
This approach requires you to manage the WebView2 Runtime yourself, so you'll need to periodically update your app together with the updated Runtime to use the latest APIs.
One of the benefits of the Fixed Version distribution mode is that you have more control over versioning, which means your app doesn't need to test whether the latest APIs are present.
However, this approach also means that the WebView2 Runtime isn't automatically updated on clients, so you'll need to update your app and the Runtime manually.
The Fixed Version binaries are quite large, weighing in at over 250 MB, which will make your app package larger by that amount.
To use the Fixed Version distribution mode, you'll need to download the Fixed Version of the WebView2 Runtime as a package, decompress it using a command-line command or a decompression tool like WinRAR, and then include all the decompressed binaries in your app package.
Here's a step-by-step guide to using the Fixed Version distribution mode:
- Download the Fixed Version of the WebView2 Runtime from Download the WebView2 Runtime.
- Decompress the WebView2 Runtime package using a command-line command or a decompression tool like WinRAR.
- Include all the decompressed Fixed Version binaries in your app package.
- Indicate the path to the Fixed Version binaries when creating the WebView2 environment.
- Package and ship the Fixed Version binaries with your app.
- Update the binaries as appropriate.
Note that starting with Fixed Version 120, developers of unpackaged Win32 applications using Fixed Version are required to run certain commands for Fixed Version to continue working on Windows 10 devices.
Handle Evergreen Updates
Handling Evergreen Updates can be a bit tricky, but don't worry, I've got you covered.
New versions of the Evergreen WebView2 Runtime are automatically downloaded to the client, but your app will continue to use the previous version if it runs continuously. This has security implications because the previous version might have security vulnerabilities that are fixed in the new version.

You should consider whether it's important for your app to adopt the latest version of the WebView2 Runtime as soon as possible, based on your app's threat model. For example, if your WebView2 app accesses third-party content, that content should be considered untrusted, so your app would need to use the latest version of the WebView2 Runtime.
To use the new version of the WebView2 Runtime, you need to either release all references to the previous WebView2 environment objects, or restart your app. The next time your app creates a new WebView2 environment, the app will use the new version of the WebView2 Runtime.
Here's a list of options to handle Evergreen updates:
- Release all references to the previous WebView2 environment objects.
- Restart your app.
- Have an event handler for the NewBrowserVersionAvailable event to notify the user to restart the app.
If your app handles restarting the app, consider saving the user state before the WebView2 app exits. This will help ensure a smooth transition for the user.
Security and Configuration
WebView2 is designed to be secure and can be configured to meet specific security requirements. It uses the Microsoft Edge browser engine, which has a strong track record of security.
To ensure security, WebView2 uses the same security features as the Microsoft Edge browser, including sandboxing and data execution prevention. This helps prevent malicious code from running on the user's system.
WebView2 can be configured to run in a specific security zone, such as the Internet zone or the Local Intranet zone. This allows developers to control how WebView2 interacts with web pages and resources.
WebView2 also supports various security-related APIs, including the JavaScript API and the C++ API. These APIs can be used to implement additional security features and controls.
Overall, WebView2 provides a secure and configurable solution for embedding web content in desktop applications.
Blocked Internal URLs
Microsoft Edge's default key bindings can change after an update, which might affect your workflow.
If a keyboard shortcut is turned off by default, it could be turned on if the feature is now supported in WebView2.
This change can be a bit of a nuisance, especially if you've grown accustomed to a particular shortcut.
You can expect the default key bindings to change as Microsoft Edge updates its features and functionality.
Preventing Shortcut Changes During Update

If you want to prevent your keyboard shortcuts from changing during updates, you can set AreBrowserAcceleratorKeysEnabled to FALSE. This will turn off all keys that access browser features, but keeps all basic text-editing and movement shortcuts turned on.
Setting AreBrowserAcceleratorKeysEnabled to FALSE is a straightforward way to maintain consistency in your keyboard shortcuts. It's a simple solution that can save you from frustration caused by unexpected changes.
Here's a list of keyboard shortcuts that will remain active even when AreBrowserAcceleratorKeysEnabled is set to FALSE:
Keep in mind that setting AreBrowserAcceleratorKeysEnabled to FALSE will also turn off other keyboard shortcuts, including some that are not listed in the table.
Design and Samples
The WebView2 Samples repo is a treasure trove of resources for developers. It contains several types of samples for WebView2, including Getting Started tutorial projects that result from following the steps in the Getting Started tutorials.
These tutorial projects are like Hello World basic apps, completed Visual Studio projects that demonstrate the basic functionality of WebView2. They're perfect for getting started with WebView2.
The repo also includes Sample apps, which are WebView2 sample apps for various frameworks and platforms, as Visual Studio projects. These samples have menus and demonstrate various APIs, making them a great resource for learning more about WebView2.
Here are the different types of samples you can find in the WebView2 Samples repo:
- Getting Started tutorial projects
- Sample apps
- Deployment samples
Design Guidelines
Design Guidelines are essential for creating a seamless user experience in WebView2. Most features work the same in WebView2 and Microsoft Edge, with modifications made only when necessary.
One key aspect of these guidelines is that features that don't make sense in the context of WebView2 are either modified or turned off. This ensures that the user interface remains intuitive and user-friendly.
Another important consideration is branding. WebView2 features don't include Microsoft Edge branding, which helps maintain a consistent look and feel across different platforms.
Here are the design guidelines summarized:
- Most features work the same in WebView2 and Microsoft Edge.
- Features that don't make sense in WebView2 are modified or turned off.
- WebView2 features don't include Microsoft Edge branding.
Samples
The WebView2Samples repo offers a range of samples for developers to explore.
These samples are organized into three categories: Getting Started tutorial projects, Sample apps, and Deployment samples.
Getting Started tutorial projects are completed Visual Studio projects that result from following the steps in the Getting Started tutorials. They're like Hello World basic apps.
Sample apps are WebView2 sample apps for various frameworks and platforms, as Visual Studio projects. They demonstrate various APIs and have menus.
Deployment samples demonstrate deploying the WebView2 Runtime. For more information, see the Deployment samples section.
Here are the three categories of samples in the WebView2Samples repo:
- Getting Started tutorial projects: Completed Visual Studio projects that result from following the Getting Started tutorials.
- Sample apps: WebView2 sample apps for various frameworks and platforms, as Visual Studio projects.
- Deployment samples: Samples that demonstrate deploying the WebView2 Runtime.
Comparison and Alternatives
Traditional web browsers like Microsoft Edge and Chrome have their limitations when it comes to integrating web content within native applications.
One of the main reasons to use WebView2 is its lightweight design, which uses fewer resources and potentially loads web content faster within your app.
Another advantage of WebView2 is its ability to use app-specific features, such as accessing files, geolocation, and user authentication, within the embedded web content. This level of integration is harder to achieve with traditional browsers.
One of the benefits of WebView2 is its offline access feature, which allows developers to create features for offline access to certain web content within the app. This is useful when users have limited or no internet access.
Traditional browsers require an internet connection, but WebView2 doesn't.
Featured Images: pexels.com


