Search code examples
asp.net-web-apidapr

Dapr not running in stand alone mode


I am pulling my hair out trying to get a basic ASP.NET Core API working with Dapr locally. I have followed the docs and still no luck. I'm sure I'm just missing something basic, but I just can't work it out.

These are the steps I have done so far to try and get this working:

  1. Installed Dapr CLI (cli version 0.11.0)
  2. Executed dapr init --runtime-version 1.0.0-rc.3 (3 docker containers installed and running)
  3. Navigated to my dotnet project and executed the following command - dapr run --app-id microservicea --app-port 5000 --dapr-http-port 55000 --dapr-grpc-port 55001 -- dotnet run

After executing the dapr run command, the project builds and various Dapr logs appear, however, I also get the following message:

Could not update sidecar metadata for cliPID: PUT http://127.0.0.1:55000/v1.0/metadata/cliPID giving up after 5 attempts

This indicates to me that the sidecar is not running as a process, or just not accessible.

I have no idea what I'm doing wrong.

As a side note, I did notice that if I matched the dapr-http-port to the port in the launchsettings.json, I get the following message - You're up and running! Both Dapr and your app logs will appear here. But it still doesn't work when I try to call the http://127.0.0.1:5000/v1.0/invoke/microservicea/method/GetSomeData endpoint.

Some help with this would be most appreciated. If I can't get this basic example working, then I'm going to have to abandon Dapr and look for an alternative to stitch together my microservices.


Solution

  • So it turns out the problem was I had the wrong versions of the Dapr CLI and Runtime installed. At the current time of writing, I made sure I had version 1.0.0-rc.3 of the CLI tool installed, and then installed version 1.0.0-rc.3 of the runtime (dapr init --runtime-version 1.0.0-rc.3). Once they were installed, everything worked.