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 #30977

Closed
DL444 opened this issue Mar 16, 2021 · 4 comments · Fixed by dotnet/vscode-csharp#4445
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 good first issue Good for newcomers. help wanted Up for grabs. We would accept a PR to help resolve this issue
Milestone

Comments

@DL444
Copy link

DL444 commented Mar 16, 2021

Duplicate of #30879, which is automatically closed as resolved but is in fact not. As per Issue Management Policies, a new issue is opened.

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.

It is suggested that adding runtimeExecutable in a browserConfig object can solve the problem, but in my case this results in the following warning.

Property browserConfig is not allowed.

See #30879 for more information.

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.

  5. Adding either runtimeExecutable or browserConfig properties will generate a warning, and they do not solve the problem.

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

See #30879 for details. Full launch.json config is attached 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

launch.json config

Full:

{
    "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}"
        }
    ]
}

Minimal reproducible:

{
    "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"
            }
        }
    ]
}
@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 16, 2021
@captainsafia
Copy link
Member

I see what's up here now.

The config definition didn't get moved over from our shimmed extension to the official C# extension.

@DL444 Would you be interested in contributing a fix for this? You'll need to sync the contents from

https://github.com/dotnet/aspnetcore-tooling/blob/c866a4bce578412c78443988c957fccacf5494cd/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode.Extension/package.json#L68

to

https://github.com/OmniSharp/omnisharp-vscode/blob/a2c3a9d5024399ee65f77992dd81b63831d5cca6/package.json#L3161

Let me know if you're interested in working on this.

@captainsafia captainsafia added good first issue Good for newcomers. help wanted Up for grabs. We would accept a PR to help resolve this issue labels Mar 18, 2021
@captainsafia captainsafia added this to the Next sprint planning milestone Mar 18, 2021
@ghost
Copy link

ghost commented Mar 18, 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.

@DL444
Copy link
Author

DL444 commented Mar 18, 2021

@captainsafia
Sure, I'll work on it today or tomorrow when I get time.

@DL444
Copy link
Author

DL444 commented Mar 18, 2021

I have created a PR in that repo. See dotnet/vscode-csharp#4445.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 24, 2021
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 good first issue Good for newcomers. help wanted Up for grabs. We would accept a PR to help resolve this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants