dotnet / dotnet/project-system
Support WebView2 debugging
- Dominant language
- C#
- Stars
- 1k
- Forks
- 415
- PR merge metrics
- No merged PRs in 30d
Description
We need to make a series of changes to the project system to allow the user to enable the JavaScript debug engine when debugging a WinForms/WPF/WinUI app that includes a WebView2 control. There are three distinct pieces of work:
- [ ] Property page UI changes. First, we need an "Enable WebView2 debugging" check box added to the debug property page. This would be similar to, and visually grouped with, the "Enable native code debugging" and "Enable SQL debugging" check boxes. We also need a text box with the path to the "web root"--the location where the debugger should look for JavaScript files. These should only be shown when using the new project system.
- [ ] Adding methods for reading and writing these settings from `ILaunchProfile`. See `LaunchProfileExtensions.IsNativeDebuggingEnabled` and `LaunchProfileExtensions.IsSqlDebuggingEnabled` for examples of how those settings are read.
- [ ] Update `ProjectLaunchTargetsProvider` to add the appropriate debug engine for WebView2 debugging. Again, see how the native and SQL debugging engines are enabled. Also, I believe the "web root" setting needs to be translated into an additional environment variable. Follow up with the JavaScript tooling team to get the details about that.
- [ ] Update the .xaml files that back the property pages for Codespaces to add support for these new properties.
There are a couple of additional things we *could* do but are not necessary:
- [ ] Add the debug engine to the Managed Desktop development work load. Otherwise it is possible that the user could enable WebView2 debugging, and then when they try to start the debugger they get an error. It would be worth checking on how we ensure that the native debug engine is present even if the native desktop development workload hasn't been installed (or even if we ensure that).
- [ ] Conditionally show the "Enable WebView2 debugging" check box. Conditions TBD.
Contributor guide
Assessment
This issue has not been assessed yet.