You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- only enough info to differentiate this dir level vs the others; what is different about this dir compared to the sibling dirs? -->
4
+
These are completed Visual Studio projects that result from following the steps in the [Getting Started tutorials](https://docs.microsoft.com/microsoft-edge/webview2/get-started/get-started).
<!-- only enough info to differentiate this sample vs the others; what is different about this sample compared to the sibling samples? -->
13
+
This sample, **WPF_GettingStarted**, is the completed Visual Studio project that results from following the steps in the tutorial [Get started with WebView2 in WPF apps](https://docs.microsoft.com/microsoft-edge/webview2/get-started/wpf).
description: "Getting started with WebView2 for Win32 apps doc"
2
+
description: "Completed Visual Studio project from the tutorial Get started with WebView2 in Win32 apps."
3
3
languages:
4
4
- cpp
5
5
page_type: sample
6
6
products:
7
7
- microsoft-edge
8
-
urlFragment: webview2-win32-getting-started
8
+
urlFragment: Win32_GettingStarted
9
9
---
10
-
# Getting Started with WebView2 for Win32 apps
10
+
# Get started with WebView2 in Win32 apps
11
11
12
-
This sample relates to the [Getting started with WebView2 for Win32 apps](https://docs.microsoft.com/microsoft-edge/webview2/gettingstarted/win32) doc.
<!-- only enough info to differentiate this sample vs the others; what is different about this sample compared to the sibling samples? -->
13
+
This sample, **Win32_GettingStarted**, is the completed Visual Studio project that results from following the steps in the tutorial [Get started with WebView2 in Win32 apps](https://docs.microsoft.com/microsoft-edge/webview2/get-started/win32).
description: "Completed Visual Studio project from the tutorial Get started with WebView2 in WinForms apps."
3
+
languages:
4
+
- csharp
5
+
page_type: sample
6
+
products:
7
+
- microsoft-edge
8
+
urlFragment: WinForms_GettingStarted
9
+
---
10
+
# Get started with WebView2 in WinForms apps
11
+
12
+
<!-- only enough info to differentiate this sample vs the others; what is different about this sample compared to the sibling samples? -->
13
+
This sample, **WinForms_GettingStarted**, is the completed Visual Studio project that results from following the steps in the tutorial [Get started with WebView2 in WinForms apps](https://docs.microsoft.com/microsoft-edge/webview2/get-started/winforms).
<!-- only enough info to differentiate this sample vs the others; what is different about this sample compared to the sibling samples? -->
13
+
This sample, **WinUI3_GettingStarted**, is the completed Visual Studio project that results from following the steps in the tutorial [Get started with WebView2 in WinUI 3 (Windows App SDK) apps](https://docs.microsoft.com/microsoft-edge/webview2/get-started/winui).
This repository contains getting started apps as well as sample apps that demonstrate the features and usage patterns of [WebView2](https://docs.microsoft.com/microsoft-edge/webview2/). As we add more features to WebView2, we will regularly update our samples.
3
+
This repo contains several types of samples for WebView2:
4
4
5
-
In the [GettingStarted](./GettingStartedGuides/) folder you will find the starter code for its respective guide listed below:
* Getting Started tutorial projects - Completed Visual Studio projects that result from following the steps in the [Getting Started tutorials](https://docs.microsoft.com/microsoft-edge/webview2/get-started/get-started).
10
6
11
-
In the [SampleApps](./SampleApps/) folder you will find:
12
-
-[WebView2Samples.sln](SampleApps/WebView2Samples.sln) - a collective solution that includes [WebView2APISample.vcxproj](SampleApps/WebView2APISample/WebView2APISample.vcxproj), [WebView2SampleWinComp.vcxproj](SampleApps/WebView2SampleWinComp/WebView2SampleWinComp.vcxproj), [WebView2WpfBrowser.csproj](SampleApps/WebView2WpfBrowser/WebView2WpfBrowser.csproj), [WebView2WindowsFormsBrowser.csproj](SampleApps/WebView2WindowsFormsBrowser/WebView2WindowsFormsBrowser.csproj), [WV2DeploymentWiXCustomActionSample](/SampleApps/WV2DeploymentWiXCustomActionSample/README.md), and [WV2DeploymentWiXBurnBundleSample](/SampleApps/WV2DeploymentWiXBurnBundleSample/README.md).
7
+
* Sample apps - WebView2 sample apps for various frameworks and platforms, as Visual Studio projects. For more information, see [Sample apps](https://docs.microsoft.com/microsoft-edge/webview2/code-samples-links).
13
8
14
-
Share feedback in the [WebView2 Feedback repo](https://aka.ms/webviewfeedback).
15
-
16
-
## Win32 C/C++
17
-
18
-
#### Getting Started
19
-
20
-
Start with the [Win32 WebView2 getting-started guide](https://docs.microsoft.com/microsoft-edge/webview2/gettingstarted/win32) to learn how to setup a WebView within a Win32 application.
21
-
22
-
This guide uses the [Win32_GettingStarted](./GettingStartedGuides/Win32_GettingStarted) sample code from the [GettingStartedGuides](./GettingStartedGuides/) directory.
23
-
24
-
#### Comprehensive API Sample
25
-
26
-
The **Win32 C++ Sample** is in the [WebView2APISample](./SampleApps/WebView2APISample) directory and [WebView2SampleWinComp](./SampleApps/WebView2SampleWinComp) directory.
27
-
28
-
#### Multiple WebViews Sample
29
-
30
-
The [WebView2Browser](https://github.com/MicrosoftEdge/WebView2Browser) is an additional Win32 WebView2 sample project that uses multiple WebViews in a single application. Clone this project by running `git clone https://github.com/MicrosoftEdge/WebView2Browser.git`.
31
-
32
-
Follow the [WebView2Browser guide](https://github.com/MicrosoftEdge/WebView2Browser) to learn how to build an application that utilizes multiple WebViews.
33
-
34
-
## .NET (WPF and Windows Forms)
35
-
36
-
#### Getting Started
37
-
38
-
* Read the [WPF getting started guide](https://docs.microsoft.com/microsoft-edge/webview2/gettingstarted/wpf) for WebView2 in WPF applications.
39
-
40
-
* See the [Windows Forms getting started guide](https://docs.microsoft.com/microsoft-edge/webview2/gettingstarted/winforms) for WebView2 in WinForms applications.
41
-
42
-
#### Comprehensive API Sample
43
-
44
-
* The **WPF Sample** is in the [WebView2WpfBrowser](./SampleApps/WebView2WpfBrowser) directory.
45
-
* The **Windows Forms Sample** is in the [WebView2WindowsFormsBrowser](./SampleApps/WebView2WindowsFormsBrowser) directory.
46
-
47
-
## UWP/WinUI
48
-
49
-
The **UWP WinUI Sample** is in the [WinUI Controls Gallery](https://github.com/microsoft/Xaml-Controls-Gallery/tree/winui3preview) directory.
50
-
51
-
## WebView2 Deployment
52
-
53
-
To help developers understand how to [deploy Evergreen WebView2 Runtime](https://docs.microsoft.com/microsoft-edge/webview2/concepts/distribution#deploying-the-evergreen-webview2-runtime) with your applications, see the following samples:
54
-
55
-
*[WV2DeploymentWiXCustomActionSample](/SampleApps/WV2DeploymentWiXCustomActionSample/README.md) creates a [WiX](https://wixtoolset.org/) installer for [WebView2APISample](./SampleApps/WebView2APISample/README.md) and uses [WiX Custom Action](https://wixtoolset.org/documentation/manual/v3/wixdev/extensions/authoring_custom_actions.html) to chain-install the Evergreen WebView2 Runtime.
56
-
*[WV2DeploymentWiXBurnBundleSample](/SampleApps/WV2DeploymentWiXBurnBundleSample/README.md) creates a [WiX](https://wixtoolset.org/) installer for [WebView2APISample](./SampleApps/WebView2APISample/README.md) and uses [WiX Burn Bundle](https://wixtoolset.org/documentation/manual/v3/bundle/) to chain-install the Evergreen WebView2 Runtime.
57
-
*[WV2DeploymentVSInstallerSample](/SampleApps/WV2DeploymentVSInstallerSample/README.md) uses the [Microsoft Visual Studio Installer Projects](https://marketplace.visualstudio.com/items?itemName=visualstudioclient.MicrosoftVisualStudio2017InstallerProjects) to create an installer for [WebView2APISample](./SampleApps/WebView2APISample/README.md) and chain-install the Evergreen WebView2 Runtime.
58
-
59
-
## Next Steps
60
-
61
-
* See [Introduction to Microsoft Edge WebView2](https://aka.ms/webview) to learn more about WebView2.
62
-
* To submit an issue specifically about this repo, see [Issues | MicrosoftEdge\/WebView2Samples](https://github.com/MicrosoftEdge/WebView2Samples/issues).
63
-
* Share feedback about the WebView2 control in the [WebView2 Feedback repo](https://aka.ms/webviewfeedback).
9
+
* Deployment samples - Samples that demonstrate deploying the WebView2 Runtime. For more information, see [Deployment samples](https://docs.microsoft.com/microsoft-edge/webview2/samples/deployment-samples).
<!-- only enough info to differentiate this dir level vs the others; what is different about this dir compared to the sibling dirs? -->
4
+
This directory contains:
5
+
6
+
* Sample apps - WebView2 sample apps for various frameworks and platforms, as Visual Studio projects. For more information, see [Sample apps](https://docs.microsoft.com/microsoft-edge/webview2/code-samples-links).
7
+
8
+
* Deployment samples - Samples that demonstrate deploying the WebView2 Runtime. For more information, see [Deployment samples](https://docs.microsoft.com/microsoft-edge/webview2/samples/deployment-samples).
description: "Demonstrate the usage patterns of WebView2 CDP Extension in WPF."
2
+
description: "Demonstrates the usage patterns of WebView2 and the WebView2 CDP Extension in WPF apps."
3
3
extendedZipContent:
4
4
-
5
5
path: SharedContent
@@ -12,37 +12,13 @@ languages:
12
12
page_type: sample
13
13
products:
14
14
- microsoft-edge
15
-
urlFragment: WV2CDPExtensionSample
15
+
urlFragment: WV2CDPExtensionWPFSample
16
16
---
17
17
# WebView2 CDP Extension
18
18
19
-
This application built with the [WebView2 CDP Extension](https://aka.ms/webviewcdp) that defines all CDP methods, events, and types.
19
+
<!-- only enough info to differentiate this sample vs the others; what is different about this sample compared to the sibling samples? -->
20
+
This sample, **WV2CDPExtensionWPFSample**, is built with the WebView2 CDP Extension. This sample calls Chrome DevTools Protocol (CDP) methods on a `DevToolsProtocolHelper` object in WebView2. This sample is built as a WPF Visual Studio 2019 project. It uses C# in the WebView2 environment.
20
21
21
-
The WV2CDPExtensionSample showcases of Utilizing Chrome DevTools Protocol functions using a DevToolsProtocolHelper object in WebView2. It is built as a WPF [Visual Studio 2019](https://visualstudio.microsoft.com/vs/) project and makes use of C# in the WebView2 environment.
22
+
To use this sample, see [WPF sample app with CDP extension](https://docs.microsoft.com/microsoft-edge/webview2/samples/wv2cdpextensionwpfsample).
22
23
23
-
If this is your first time using WebView2, we recommend first following the [Getting Started](https://docs.microsoft.com/microsoft-edge/webview2/gettingstarted/wpf) guide, which goes over how to create a WebView2 and walks through some basic WebView2 functionality.
24
-
25
-
## Prerequisites
26
-
27
-
-[Microsoft Edge (Chromium)](https://www.microsoftedgeinsider.com/download/) installed on a supported OS. Currently we recommend the latest version of the Edge Canary channel.
28
-
-[Visual Studio](https://visualstudio.microsoft.com/vs/) with .NET support installed.
29
-
- Latest version of our [WebView2 SDK](https://aka.ms/webviewnuget), which is included in this project.
30
-
- Latest release version of our [WebView2 CDP Extension](https://aka.ms/webviewcdpnuget), which is included in this project.
31
-
32
-
## Build the WebView2 WPF Browser
33
-
34
-
Clone the repository and open the solution in Visual Studio. WebView2 and WebView2 DevToolsProtocolExtension is already included as a NuGet package* in this project.
35
-
36
-
- Open the solution in Visual Studio 2019**
37
-
- Set the target you want to build (Debug/Release, AnyCPU)
38
-
- Build the project file: _WV2CDPExtensionSample.csproj_
39
-
40
-
That's it! Everything should be ready to just launch the app.
41
-
42
-
*You can get the WebView2 and WebView2 DevToolsProtocolExtension NugetPackage through the Visual Studio NuGet Package Manager.
43
-
44
-
**You can also use Visual Studio 2017 by changing the project's Platform Toolset in Project Properties/Configuration properties/General/Platform Toolset. You might also need to change the Windows SDK to the latest version available to you.
45
-
46
-
## Code of Conduct
47
-
48
-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact opencode@microsoft.com with any additional questions or comments.
Copy file name to clipboardExpand all lines: SampleApps/WV2DeploymentVSInstallerSample/README.md
+4-45Lines changed: 4 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,50 +14,9 @@ products:
14
14
- microsoft-edge
15
15
urlFragment: WV2DeploymentVSInstallerSample
16
16
---
17
-
# WebView2 Deployment VS Installer Sample
17
+
# WebView2 Deployment Visual Studio installer
18
18
19
-
To help developers understand how to [deploy the Evergreen WebView2 Runtime](https://docs.microsoft.com/microsoft-edge/webview2/concepts/distribution#deploying-the-evergreen-webview2-runtime) with your application, this sample uses the [Microsoft Visual Studio Installer Projects](https://marketplace.visualstudio.com/items?itemName=visualstudioclient.MicrosoftVisualStudio2017InstallerProjects) to create an installer for [WebView2APISample](./SampleApps/WebView2APISample/README.md) and chain-install the Evergreen WebView2 Runtime.
19
+
<!-- only enough info to differentiate this sample vs the others; what is different about this sample compared to the sibling samples? -->
20
+
This sample, **WV2DeploymentVSInstallerSample**, demonstrates how to deploy the Evergreen WebView2 Runtime with your application. This sample uses Microsoft Visual Studio Installer Projects to create an installer for the [WebView2APISample](../WebView2APISample//README.md) and chain-install the Evergreen WebView2 Runtime.
20
21
21
-
This sample showcases [deployment workflows](https://docs.microsoft.com/microsoft-edge/webview2/concepts/distribution#deploying-the-evergreen-webview2-runtime) for,
22
-
23
-
* Download the Evergreen WebView2 Runtime Bootstrapper through link.
24
-
* Package the Evergreen WebView2 Runtime Bootstrapper.
25
-
* Package the Evergreen WebView2 Runtime Standalone Installer.
26
-
27
-
## Prerequisites
28
-
29
-
*[Visual Studio](https://visualstudio.microsoft.com/vs/) with C++ support installed.
30
-
*[Microsoft Visual Studio Installer Projects](https://marketplace.visualstudio.com/items?itemName=visualstudioclient.MicrosoftVisualStudio2017InstallerProjects).
31
-
32
-
## Build steps
33
-
34
-
To create a VS installer that chain-install the Evergreen WebView2 Runtime,
35
-
36
-
1. Clone the repo.
37
-
1. Edit the `product.xml` file depending on the workflow you wish to use.
38
-
* For "Package the Evergreen WebView2 Runtime Bootstrapper",
39
-
* Within the `<PackageFiles CopyAllPackageFiles="false">` and `</PackageFiles>` section, un-comment the line `<PackageFile Name="MicrosoftEdgeWebview2Setup.exe" />`, and comment out other lines.
40
-
* Within the `<Commands Reboot="Defer">` and `</Commands>` section, make sure `PackageFile` points to `"MicrosoftEdgeWebview2Setup.exe"` so that the VS installer would be using the Bootstrapper.
41
-
* For "Download the Evergreen WebView2 Runtime Bootstrapper through link",
42
-
* Within the `<PackageFiles CopyAllPackageFiles="false">` and `</PackageFiles>` section, un-comment the line `<PackageFile Name="MicrosoftEdgeWebview2Setup.exe" HomeSite="WebViewRuntime" PublicKey="..."/>`, and comment out other lines. Note that the PublicKey for the WebView2 Runtime Bootstrapper may change without notice and we are working on addressing this issue. For now, you may need to replace it with an updated PublicKey.
43
-
* Within the `<Commands Reboot="Defer">` and `</Commands>` section, make sure `PackageFile` points to `"MicrosoftEdgeWebview2Setup.exe"` so that the VS installer would be using the Bootstrapper.
44
-
* For "Package the Evergreen WebView2 Runtime Standalone Installer",
45
-
* Within the `<PackageFiles CopyAllPackageFiles="false">` and `</PackageFiles>` section, un-comment the line `<PackageFile Name="MicrosoftEdgeWebView2RuntimeInstallerX64.exe" />`, and comment out other lines.
46
-
* Within the `<Commands Reboot="Defer">` and `</Commands>` section, make sure `PackageFile` points to `"MicrosoftEdgeWebView2RuntimeInstallerX64.exe"` so that the VS installer would be using the Standalone Installer.
47
-
* If you're targeting non-X64 devices, you may also want to edit the `MicrosoftEdgeWebView2RuntimeInstallerX64` filename to reflect the correct architecture.
48
-
1. If you plan to package either the Bootstrapper or the Standalone Installer, [download](https://developer.microsoft.com/microsoft-edge/webview2/) the Bootstrapper or the Standalone Installer and place it under the `WV2DeploymentVSInstallerSample` folder.
49
-
1. Copy the entire `WV2DeploymentVSInstallerSample` folder, and paste it under either,
50
-
*`Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\`, or
51
-
*`<VS Install Dir>\MSBuild\Microsoft\VisualStudio\BootstrapperPackages\` (requires at least VS 2019 Update 7).
52
-
1. Create a Setup Project in Visual Studio.
53
-
* In Visual Studio menu, select `File > New > Project`.
54
-
* Search for `Setup Project`.
55
-

56
-
* Create a Setup Project.
57
-
1. Add WebView2 Runtime as a prerequisite.
58
-
* In Visual Studio menu, select `Project > Properties`.
59
-
* In the Property page, select `Prerequisites..`.
60
-

61
-
* Check `Edge WebView2 runtime`, and un-check other prerequisites. Select `OK`.
62
-

63
-
1. Build the Setup project.
22
+
For more information, see [WebView2 Deployment Visual Studio installer](https://docs.microsoft.com/microsoft-edge/webview2/samples/wv2deploymentvsinstallersample).
0 commit comments