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 WebAssembly debugger cannot launch an Edge version other than stable #30879

Closed
DL444 opened this issue Mar 12, 2021 · 5 comments
Closed
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-debugging This issue is related to debugging of Blazor WebAssembly apps feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. Status: Resolved

Comments

@DL444
Copy link

DL444 commented Mar 12, 2021

Describe the bug

Blazor WebAssembly debugger cannot launch an Edge version other than stable because the launch.json config for blazorwasm does not support runtimeExecutable property.

When you try to launch the debugger, the following message is shown:

Unable to launch browser: "Unable to find Edge version stable. Available auto-discovered versions are: ["dev"]. You can set the "runtimeExecutable" in your launch.json to one of these, or provide an absolute path to the browser executable."

Adding runtimeExecutable in launch.json results in VSC reporting the following error, and the problem is not mitigated.

Property runtimeExecutable is not allowed.

To Reproduce

On a machine with dev/canary and no stable version of Microsoft Edge:

  1. Create a ASP.NET Blazor WebAssembly project and open it in VSC. Or use this repro repo and skip to step 3.

  2. Create the default Blazor WebAssembly run task, which can be something like this:

    {
        "name": "Launch and Debug Standalone Blazor WebAssembly App",
        "type": "blazorwasm",
        "request": "launch",
        "cwd": "${workspaceFolder}",
        "browser": "edge"
    }
  3. Start the debugger from VSC.

  4. The web app starts but browser does not launch. The error message shows up a while later.

Further technical details

  • ASP.NET Core version: 5.0
  • Output of dotnet --info:
.NET SDK (reflecting any global.json):
 Version:   5.0.102
 Commit:    71365b4d42

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  11.0
 OS Platform: Darwin
 RID:         osx.11.0-x64
 Base Path:   /usr/local/share/dotnet/sdk/5.0.102/

Host (useful for support):
  Version: 5.0.2
  Commit:  cb5f173b96

.NET SDKs installed:
  3.1.403 [/usr/local/share/dotnet/sdk]
  3.1.404 [/usr/local/share/dotnet/sdk]
  3.1.405 [/usr/local/share/dotnet/sdk]
  5.0.101 [/usr/local/share/dotnet/sdk]
  5.0.102 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.11 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.23 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  • IDE: Visual Studio Code 1.54.1
@mkArtakMSFT mkArtakMSFT added area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly feature-blazor-debugging This issue is related to debugging of Blazor WebAssembly apps labels Mar 12, 2021
@captainsafia
Copy link
Member

@DL444 You can try passing the runtimeExecutable under the browserConfig property like so:

{
  "browserConfig": {
    "runtimeExecutable": "foo"
  }
}

@captainsafia captainsafia added the ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. label Mar 15, 2021
@ghost ghost added the Status: Resolved label Mar 15, 2021
@DL444
Copy link
Author

DL444 commented Mar 15, 2021

@captainsafia Unfortunately browserConfig doesn't seem to be an accepted property as well.

Screen Shot 2021-03-16 at 12 04 16 AM

@captainsafia
Copy link
Member

@DL444 Can you share your entire launch.json? The snippet you shared seems to indicate that the config was included in a coreclr debug type which isn't valid.

@DL444
Copy link
Author

DL444 commented Mar 15, 2021

@captainsafia
Sure, here it is. I do have to admit that this is edited from an existing configuration.

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Backend",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "Build Backend",
            "program": "${workspaceFolder}/Solution.Backend/bin/Debug/net5.0/Solution.Backend.dll",
            "args": [],
            "cwd": "${workspaceFolder}/Solution.Backend",
            "console": "internalConsole",
            "stopAtEntry": false
        },
        {
            "name": "Frontend",
            "type": "blazorwasm",
            "request": "launch",
            "preLaunchTask": "Build Frontend",
            "program": "${workspaceFolder}/Solution.Web/bin/Debug/net5.0/Solution.Web.dll",
            "cwd": "${workspaceFolder}/Solution.Web",
            "serverReadyAction": {
                "action": "openExternally",
                "pattern": "\\bNow listening on:\\s+(https?://\\S+)"
            },
            "browser": "edge",
            "runtimeExecutable": "dev",
            "browserConfig": {
                "runtimeExecutable": "dev"
            },
            "env": {
                "ASPNETCORE_ENVIRONMENT": "Development"
            }
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach",
            "processId": "${command:pickProcess}"
        }
    ]
}

However, this configuration also generates the same warning. This one is generated by VSC from scratch.

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch and Debug Standalone Blazor WebAssembly App",
            "type": "blazorwasm",
            "request": "launch",
            "cwd": "${workspaceFolder}",
            "browser": "edge",
            "runtimeExecutable": "dev",
            "browserConfig": {
                "runtimeExecutable": "dev"
            }
        }
    ]
}

@ghost
Copy link

ghost commented Mar 16, 2021

This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.

See our Issue Management Policies for more information.

@ghost ghost closed this as completed Mar 16, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Apr 15, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-debugging This issue is related to debugging of Blazor WebAssembly apps feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. Status: Resolved
Projects
None yet
Development

No branches or pull requests

3 participants