Skip to content

WithDaprSidecar doesn't mimic WaitFor on its parent resource #1073

Closed

Description

@atrauzzi

Describe the bug

Whenever I call WithDaprSidecar on a resource that has a WaitFor, the sidecar always starts immediately.

Regression

No response

Steps to reproduce

Make one resource that uses a Dapr sidecar wait on another.

Expected behavior

Whenever I call WithDaprSidecar on a resource, I'd expect it to mimic any WaitFor instructions made against its parent.

Screenshots

No response

IDE and version

Rider

IDE version

No response

Nuget packages

Latest

Additional context

No response

Help us help you

Yes, but only if others can assist

Activity

  1. kristremblay commented on Dec 29, 2025

    @kristremblay
    Contributor

    I am facing the same issue. Latest version of everything, .net 10, MacOS.

    The hacky way I was able to use to get it to work the way I expected: drop the WithDaprSidecar call and instead write an executable that prefaces the dapr command with a sleep.

    var api = builder.AddProject<Projects.PropertyManager_Api>("api")
        .WithReference(db)
        .WithReference(rabbitMq)
        .WaitFor(postgres)
        .WaitFor(rabbitMq);
    
    builder.AddExecutable(
            "api-dapr-sidecar",
            "bash",
            args:
            [
                "-c",
                "sleep 30 && dapr run --app-id api --app-port 5225 --dapr-http-port 3500 --dapr-grpc-port 3501 --resources-path ../components/ --config ../components/dapr-config.yaml --log-level debug"
            ],
            workingDirectory: ".")
        .WaitFor(api);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions