microsoft / vscode-dapr

A Visual Studio Code extension for Dapr development
Other
58 stars 18 forks source link

Unable to find task after rebuilding dev container #320

Open chris780 opened 9 months ago

chris780 commented 9 months ago

I'm new to Dapr but thanks to the great instructions here, I was able to launch and debug a simple application within my dev container.

However, after rebuilding the dev container, I get the following error when trying to run the app:

image

Re-running the Dapr: Scaffold Dapr Tasks command in VS Code and then reverting the changes it makes to launch.json and tasks.json fixes the issue - that is until the next dev container rebuild.

I have a single launch target set up in launch.json:

{
            "name": "Run User Poller",
            "type": "go",
            "request": "launch",
            "mode": "debug",
            "program": "${workspaceFolder}/cmd/user-poller/main.go",
            "args": [
                "-config=configuration/local.yaml"
            ],
            "console": "integratedTerminal",
            "env": {
                "DAPR_HTTP_PORT": "3502",
                "DAPR_GRPC_PORT": "50002"
            },
            "preLaunchTask": "dapr-debug",
            "postDebugTask": "daprd-down"
        },

My entire tasks.json is as follows:

{
    "version": "2.0.0",
    "tasks": [
        {
            "appId": "app",
            "appPort": 8080,
            "httpPort": 3502,
            "grpcPort": 50002,          
            "label": "dapr-debug",
            "type": "dapr"
        },
        {
            "appId": "app",
            "label": "daprd-down",
            "type": "daprd-down"
        }
    ]
}

Thanks in advance!

philliphoff commented 6 months ago

@karpikpl If this is still an issue, can you provide a set of repro steps? My guess is that this might be a quirk of the way VS Code loads/refreshes task configurations when rebuilding the dev container--I've seen things like that from time to time, but haven't used dev containers in some time, so I don't know the current state.

karpikpl commented 6 months ago

I think you tagged me by accident? @chris780 reported this issue