Bring the best of the Web to your .NET desktop applications with WebView2

This post has been republished via RSS; it originally appeared at: Microsoft Developer Blogs.

This blog post was written together with Palak Goel, Program Manager on Edge Product Development team. Last year at Build, we introduced WebView2, a browser control that renders web content (HTML / CSS / JavaScript) with the new Chromium-based Microsoft Edge. It was originally limited in scope to C/C++ applications. Today, we are happy to announce the release of the WebView2 preview for .NET applications! WebView2 is available for both .NET Core and .NET Framework. It can be used inside of WPF, Windows Forms and WinUI 3.0 applications all the way down to Windows 7. WebView2 controlin WPF application
Important: When installing the NuGet package, make sure to check Include prerelease checkbox and select a version with the -prerelease suffix.  Otherwise you will not get .NET support.
Going forward, we will be updating our SDK every six weeks according to the Roadmap, driven by your feedback. You can keep up with the latest updates in the Release Notes.

About the control

With the help of the WebView2 family of controls you can host web content in your desktop .NET applications and enhance them with all the benefits that web has to offer, such as dynamic content, modern user interfaces, and tooling.

A little history

Originally, we started with the WebBrowser control which is based on Internet Explorer and thus no longer suitable for modern web content. We then created an Edge-based control called WebView. This control is only available on Windows 10 and can't be included in your app. We've heard your feedback loud and clear that you want a modern and consistent control supported on all Windows versions starting from Windows 7. This is how WebView2 came to life. It is based on the Microsoft Edge Chromium platform, consistent across all Windows versions starting from Windows 7. It receives updates every 6 weeks, enabling you to consume the latest features.

Present

WebView2 supports many features such as navigation, web messaging (communication between the application and the WebView2 control), native object injection (accessing application objects directly from JavaScript) and so on. Check out our documentation for more details. At Microsoft, we are using WebView2 in many of our applications. One example is the Room Finder panel in the desktop version of Outlook. By using WebView2, we were able to reuse the code from Outlook's web UI and make it accessible directly to the desktop version. Outlook Room Finder panel hosted in WebView2 controls in desktop and web versions of Outlook

Future

Currently WebView2 is in Preview and we are working on the GA version. As a part of that effort we will be providing designer support for Windows Forms and WPF so you can enjoy the familiarity of drag-and-drop and WYSIWYG experience. See our Roadmap for more information. Today Windows Forms .NET Framework designer experience is already supported and the rest is coming.

Supported platforms

A developer preview is available for the following programming platforms:
  • Win32 C/C++
  • .NET Framework 4.6.2 or later
  • .NET Core 3.0 or later
  • WinUI 3.0
and the following versions of Windows
  • Windows 10
  • Windows 8.1
  • Windows 8
  • Windows 7
  • Windows Server 2016
  • Windows Server 2012
  • Windows Server 2012 R2
  • Windows Server 2008 R2

Getting started

Check out our getting started guides:

Give us your feedback

Your feedback is our main factor in creating the Roadmap and prioritizing work items. Please share your opinions, suggestions, and details on your scenarios in our feedback repo. We appreciate your help!

REMEMBER: these articles are REPUBLISHED. Your best bet to get a reply is to follow the link at the top of the post to the ORIGINAL post! BUT you're more than welcome to start discussions here:

This site uses Akismet to reduce spam. Learn how your comment data is processed.