microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
226 stars 11 forks source link

[BUG] A valid browser not found when debugging from local DevContainer #742

Open FBoucher opened 10 months ago

FBoucher commented 10 months ago

Describe the Issue

Debugging a web app in local DevContainer gives errors and does not allow for debugging.

image

I had the same experience on a Windows 11 and Ubuntu 22.04. It works fine when running locally (Edge is installed). When I re-open in a devContainer I have the same "A valid browser is not installed." message.

Steps To Reproduce

  1. Create a new blazor wasm
  2. reopen in a DEvContainer

devcontainer.json


{
    "name": "C# (.NET) and MySQL",
    "dockerComposeFile": "docker-compose.yml",
    "service": "devbox",
    "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}"
    , "customizations": {
        "vscode": {
            "extensions": [
                "ms-dotnettools.csharp",
                "ms-dotnettools.csdevkit",
                "ms-dotnettools.blazorwasm-companion",
                "eamodio.gitlens"
            ]
        }
    }
    , "forwardPorts": [5000, 5001, 3306]
    , "portsAttributes": {
            "5001": {
                "protocol": "https"
            }
    }
    , "remoteUser": "root"
}

dockerfile

FROM mcr.microsoft.com/devcontainers/dotnet:8.0

Expected Behavior

Debug launches with the app opening in the browser

Environment Information

timheuer commented 10 months ago

@FBoucher I don't think this is a dev kit issue, but rather needing dependencies in the devcontainer you are building to satisfy the scenarios.

timheuer commented 10 months ago

@WardenGnaw I'm not sure if these errors are coming from vsdbg or the companion. In 'normal' web debug even in a devcontainer int launches the host browser and tunnels. In wasm, it seems that assumption is not made?

Repro project: https://github.com/timheuer/csdevkit-742

WardenGnaw commented 10 months ago

@timheuer This error is from the C# Extension. Specifically https://github.com/dotnet/vscode-csharp/blob/e5c352d80af74199b832404cfe2b8e93809e84bf/src/razor/src/blazorDebug/blazorDebugConfigurationProvider.ts#L182

@phil-allen-msft Does Blazor Debugging work with dev containers?

FBoucher commented 10 months ago

Oh! I didn't realize it could be that! Looking forward knowing if WASM is supported

FBoucher commented 9 months ago

@phil-allen-msft is it supported?

MSFTJim commented 6 months ago

I am also getting these error messages. I get them when I try to use the C# DevKit and debug on a Blazor project that includes wasm (wasm or auto). If the project does not include wasm, then the devkit debug works fine. If the project does include wasm, I discovered I could just create the launch and task entries and then I can debug. I was doing this with Codespaces.

Not sure if this helps but thought I would share.

github-actions[bot] commented 6 months ago

This issue has been marked as stale after 14 days of inactivity. @[ @phil-allen-msft @], could you please take a look?