August 19th, 2020

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

Olia Gavrysh
Senior Product Manager

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!

Author

Olia Gavrysh
Senior Product Manager

Olia is working on .NET Core and WinForms. Before she was doing Machine Learning and AI at ML.NET team.

27 comments

Discussion is closed. Login to edit/delete existing comments.

  • mekki ahmedi

    I failed adding webview2 in Visual Studio toolbox . I am using VS community 2019 Version 16.7.2.
    I struggled following all articles available , stackoverflow , and github, and the failure was my end result.
    I will be good if you provide a sample project that is runing webview2 in Winforms or .Net core!

  • Jay Baer

    Thanx for the wonderful post. I am working on my blog on .net application development .Learned a lot from your piece.

  • Faisal Alshammari

    Great stuff Olia! Though it would be really awesome if it’s integrated with azure for authentication and access tokens, the current flow “i’m not very fond about it”, launches a browser window and ask for user login. If I can authenticate manage storage access and services from the same window, that will be just wow!

  • Aigner D.

    Is there any way to integrate this in a C# Unity 3d (game) engine application (for windows builds)?

  • Anonymous

    It would be very nice with Linux and macOS support so WebView2 could be used to develop cross-platform .NET Core desktop applications.

    • Palak GoelMicrosoft employee

      Hey,

      We’d love to see it too and that’s where we are heading! Stay tuned!

      • David Beavon

        @Palak Goel ...

        We’d love to see it too and that’s where we are heading! Stay tuned!
        Please explain.

        There is no cross-platform .Net Core desktop technology from Microsoft. Where do you plan to put your WebView2? Are you talking about WINUI for xbox? Are you talking about xamarin forms? What do you mean by this statement? Where exactly are you heading?

        The announcement was ...

        Read more
  • Jussi Palo

    How is today’s “happy announcement” different from what we’ve had already 3 months? I’ve used WebView2 preview on my classic WinForms C# .NET application running on Windows Server 2019 since it was announced in Build conference in May 2020.

    • Palak GoelMicrosoft employee

      Hey Jussi Palo,

      That’s great, we appreciate you developing with WebView2! Since Build, we’ve updated the SDK twice and want to increase awareness of the WebView2 control to the .NET developer community.

  • Ion Sorin Torjo

    I’d really want to know when this will actually make it back to UWP – WinUI 2, that is.
    It’s simply useless to have it WinUI 3 ready, when WinUI 3 production ready is pretty much 1 year away.

  • Mystery Man

    Hello. 😊 Thanks for letting us know about WebView2. If you don't mind, I have a couple of questions. I'm quoting the relevant sections of the post.

    With the help of the WebView2 family of controls you can host web content in your desktop .NET applications

    Host web content or simply access web content hosted elsewhere? Please answer carefully; I'm already looking for a solution to host local web content, thus creating rich client-side apps with web...

    Read more
    • Palak GoelMicrosoft employee

      Hey Fleet Command,

      1. You can host web content by creating your own local HTML/CSS/JS content or you can access web content hosted elsewhere.

      2. Fortunately not! The post is referencing an internal future version of Outlook that will ship once the WebView2 control GAs.

  • Yann Duran

    Is there any work being done to update Visual Studio’s internal WPF web control to WebView2?

    The current WebBrowser control is still IE-based, and the WebView2 control requires the canary version of Edge to be installed and doesn’t work in custom WPF tool windows when creating a VS extension.