Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blazor Desktop dev tools enablement #2542

Closed
Eilon opened this issue Feb 27, 2021 · 12 comments
Closed

Blazor Desktop dev tools enablement #2542

Eilon opened this issue Feb 27, 2021 · 12 comments
Assignees
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView
Milestone

Comments

@Eilon
Copy link
Member

Eilon commented Feb 27, 2021

Check that the debugging experience of content in the WebView works as expected on each platform

  • Can attach VS debugger (VS Win, VS Mac, VS Code) Done
  • Can use browser-based debugger from Edge, Chrome, Safari on each platform Done (Open dev tools by focusing inside the webview and pressing ctrl+shift+i or cmd+shift+i)
  • Consider defaults for whether F12 tools are enabled by default (e.g. Debug vs. Release?), whether we should abstract this presumably common setting (On, Off, Auto)
@ghost
Copy link

ghost commented Mar 1, 2021

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@SteveSandersonMS SteveSandersonMS changed the title Blazor Desktop Debugging Blazor Desktop dev tools enablement Mar 8, 2021
@Eilon Eilon transferred this issue from dotnet/aspnetcore Sep 16, 2021
@Eilon Eilon added the area-blazor Blazor Hybrid / Desktop, BlazorWebView label Sep 16, 2021
@Eilon
Copy link
Member Author

Eilon commented Feb 8, 2022

Some details on what I think this work entails:

  1. Consider smart defaults for whether dev tools are enabled in the app. For example, switch on debug/release builds (somehow) to set whether dev tools are enabled.
  2. Have there be a setting on "something" (the BlazorWebView control itself?) to set bool? EnableDevTools { get; set; } (force enable, force disable, null=default/auto)
  3. Make sure dev tools actually work on all platforms (.NET MAUI Android/WinUI/iOS/MacCatalyst, WPF, WinForms). I think right now it works fine with Android + all Windows, but not on iOS/MacCatalyst.

@javiercn javiercn self-assigned this Feb 24, 2022
@javiercn
Copy link
Member

javiercn commented Feb 25, 2022

I think we need a few things here:

  • What are the experiences we expect to work. For example:
    • Should I be able to debug JavaScript code on the webview inside Visual Studio?
    • Should I be able to open the DevTools and debug code there?
  • Steps to get this to work on each individual platform.
    • Maui
      • Android Emulator
      • Android Device
      • Windows
      • iOS Emulator
      • iOS Device
      • Mac
    • Winforms/WPF
  • Are there any tooling integrations we need to engage with partners to enable?

@Eilon
Copy link
Member Author

Eilon commented Feb 25, 2022

I think focusing this issue on using browser dev tools is all we need to focus on here. Once that works, I think everything else can work. That's all the WebView components can do anyway, and I think all other tools plug into the same system.

@javiercn
Copy link
Member

I think focusing this issue on using browser dev tools is all we need to focus on here. Once that works, I think everything else can work.

I agree, but would we want something like F5 and setting a breakpoint in JS in Visual Studio to work? That requires VS to attach the debugger (through the dev tools in chrome for example)

@Eilon
Copy link
Member Author

Eilon commented Feb 25, 2022

But with Blazor why would you want to set a breakpoint in JS code?? Just kidding, yeah, that sounds reasonable. But probably less important than F12 tools working.

@javiercn
Copy link
Member

But with Blazor why would you want to set a breakpoint in JS code?? Just kidding, yeah, that sounds reasonable. But probably less important than F12 tools working.

I think this can be enabled in parallel. We already are able to do this for Android Emulator (edge://devices/inspect) so VS should be able to connect to it too.

@Eilon
Copy link
Member Author

Eilon commented Feb 25, 2022

Some docs from Mobile Blazor Bindings in case it helps: https://docs.microsoft.com/mobile-blazor-bindings/advanced/debug-hybrid-apps

@TanayParikh
Copy link
Contributor

I think focusing this issue on using browser dev tools is all we need to focus on here.

This seems related to:

#2057 (comment)

and

dotnet/docs-maui#281

@javiercn
Copy link
Member

javiercn commented Mar 1, 2022

WRT to iOS simulator there is nothing to do/configure. These are the steps I followed to debug on the iOS simulator:

  • With the application running on the simulator
  • Open Safari on Mac OS
  • Click on Develop -> (<> Simulator) -> 0.0.0.0
  • The iOS simulator will open and you can interact with the page on the browser tools.

@TanayParikh
Copy link
Contributor

  • (Open dev tools by focusing inside the webview and pressing ctrl+shift+i or cmd+shift+i)

Doesn't work in Mac Catalyst apps: #5022

@javiercn
Copy link
Member

javiercn commented Mar 7, 2022

cfc3fab

@javiercn javiercn closed this as completed Mar 7, 2022
@mkArtakMSFT mkArtakMSFT added this to the 6.0.300-rc.1 milestone Mar 23, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Apr 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Blazor Hybrid / Desktop, BlazorWebView
Projects
None yet
Development

No branches or pull requests

4 participants