{"id":29246,"date":"2020-08-19T08:40:46","date_gmt":"2020-08-19T15:40:46","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/dotnet\/?p=29246"},"modified":"2020-08-19T08:46:22","modified_gmt":"2020-08-19T15:46:22","slug":"bring-the-best-of-the-web-to-your-net-desktop-applications-with-webview2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/bring-the-best-of-the-web-to-your-net-desktop-applications-with-webview2\/","title":{"rendered":"Bring the best of the Web to your .NET desktop applications with WebView2"},"content":{"rendered":"<p><em>This blog post was written together with Palak Goel, Program Manager on Edge Product Development team.<\/em><\/p>\n<p>Last year at Build, we introduced <a href=\"http:\/\/aka.ms\/webview\">WebView2<\/a>, 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 <a href=\"http:\/\/aka.ms\/webview\">WebView2<\/a> preview for .NET applications! <code>WebView2<\/code> is available for both .NET Core and .NET Framework. It can be used inside of <a href=\"https:\/\/docs.microsoft.com\/microsoft-edge\/WebView2\/gettingstarted\/wpf\">WPF<\/a>, <a href=\"https:\/\/docs.microsoft.com\/microsoft-edge\/WebView2\/gettingstarted\/winforms\">Windows Forms<\/a> and <a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/webview2\/gettingstarted\/winui\">WinUI 3.0<\/a> applications all the way down to Windows 7.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-29257 size-full\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/08\/webview2-1.png\" alt=\"WebView2 controlin WPF application\" width=\"983\" height=\"553\" srcset=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/08\/webview2-1.png 983w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/08\/webview2-1-300x169.png 300w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/08\/webview2-1-768x432.png 768w\" sizes=\"(max-width: 983px) 100vw, 983px\" \/><\/p>\n<blockquote><p><strong>Important:<\/strong> When installing the NuGet package, make sure to check <strong>Include prerelease<\/strong> checkbox and select a version with the <code>-prerelease<\/code> suffix.\u00a0\u00a0Otherwise you will not get .NET support.<\/p><\/blockquote>\n<p>Going forward, we will be updating our SDK every six weeks according to the <a href=\"https:\/\/docs.microsoft.com\/microsoft-edge\/webview2\/roadmap\">Roadmap<\/a>, driven by your <a href=\"http:\/\/aka.ms\/WebViewFeedback\">feedback<\/a>. You can keep up with the latest updates in the <a href=\"https:\/\/docs.microsoft.com\/microsoft-edge\/webview2\/releasenotes\">Release Notes<\/a>.<\/p>\n<h2>About the control<\/h2>\n<p>With the help of the <code>WebView2<\/code> 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.<\/p>\n<h3>A little history<\/h3>\n<p>Originally, we started with the <code>WebBrowser<\/code> control which is based on Internet Explorer and thus no longer suitable for modern web content. We then created an Edge-based control called <code>WebView<\/code>. This control is only available on Windows 10 and can&#8217;t be included in your app. We&#8217;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 <code>WebView2<\/code> 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.<\/p>\n<h3>Present<\/h3>\n<p><code>WebView2<\/code> supports many features such as navigation, web messaging (communication between the application and the <code>WebView2<\/code> control), native object injection (accessing application objects directly from JavaScript) and so on. Check out our <a href=\"http:\/\/aka.ms\/webview2\">documentation<\/a>\u00a0for more details. At Microsoft, we are using <code>WebView2<\/code> in many of our applications. One example is the Room Finder panel in the desktop version of Outlook. By using <code>WebView2<\/code>, we were able to reuse the code from Outlook&#8217;s web UI and make it accessible directly to the desktop version.<\/p>\n<p><img decoding=\"async\" class=\"size-large wp-image-29251 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/08\/outlook-1024x437.png\" alt=\"Outlook\u00a0Room\u00a0Finder\u00a0panel\u00a0hosted\u00a0in\u00a0WebView2\u00a0controls\u00a0in\u00a0desktop\u00a0and\u00a0web\u00a0versions\u00a0of\u00a0Outlook\" width=\"640\" height=\"273\" srcset=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/08\/outlook-1024x437.png 1024w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/08\/outlook-300x128.png 300w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/08\/outlook-768x328.png 768w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/08\/outlook-1536x655.png 1536w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/08\/outlook-2048x874.png 2048w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<h3>Future<\/h3>\n<p>Currently <code>WebView2<\/code> 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 <a href=\"https:\/\/docs.microsoft.com\/microsoft-edge\/webview2\/roadmap\">Roadmap<\/a> for more information. Today Windows Forms .NET Framework designer experience is already supported and the rest is coming.<\/p>\n<h2>Supported platforms<\/h2>\n<p>A\u00a0developer\u00a0preview\u00a0is\u00a0available\u00a0for\u00a0the\u00a0following\u00a0programming\u00a0platforms:<\/p>\n<ul>\n<li>Win32 C\/C++<\/li>\n<li>.NET Framework 4.6.2 or later<\/li>\n<li>.NET Core 3.0 or later<\/li>\n<li>WinUI 3.0<\/li>\n<\/ul>\n<p>and\u00a0the\u00a0following\u00a0versions\u00a0of\u00a0Windows<\/p>\n<ul>\n<li>Windows 10<\/li>\n<li>Windows 8.1<\/li>\n<li>Windows 8<\/li>\n<li>Windows 7<\/li>\n<li>Windows Server 2016<\/li>\n<li>Windows Server 2012<\/li>\n<li>Windows Server 2012 R2<\/li>\n<li>Windows Server 2008 R2<\/li>\n<\/ul>\n<h2>Getting started<\/h2>\n<p>Check\u00a0out\u00a0our\u00a0getting\u00a0started\u00a0guides:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.microsoft.com\/microsoft-edge\/WebView2\/gettingstarted\/winforms\">Getting started guide for Windows Forms<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/microsoft-edge\/WebView2\/gettingstarted\/wpf\">Getting started guide for WPF<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/webview2\/gettingstarted\/winui\">Getting started guide for WinUI 3.0<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoft-edge\/webview2\/gettingstarted\/win32\">Getting started guide for Win32<\/a><\/li>\n<\/ul>\n<h2>Give us your feedback<\/h2>\n<p>Your feedback is our main factor in creating the <a href=\"https:\/\/docs.microsoft.com\/microsoft-edge\/webview2\/roadmap\">Roadmap<\/a> and prioritizing work items. Please share your opinions, suggestions, and details on your scenarios in our <a href=\"http:\/\/aka.ms\/WebViewFeedback\">feedback repo<\/a>. We appreciate your help!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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!<\/p>\n","protected":false},"author":365,"featured_media":29257,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685,196,195,7163,509],"tags":[],"class_list":["post-29246","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","category-dotnet-core","category-dotnet-framework","category-winforms","category-wpf"],"acf":[],"blog_post_summary":"<p>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!<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/29246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/365"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=29246"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/29246\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/29257"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=29246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=29246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=29246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}