When running azd init on the root of a Net Aspire project I'm receiving an error

253 Views Asked by At

When I run azd init, I get the following error:

ERROR: only a single Aspire project is supported at this time

enter image description here

1

There are 1 best solutions below

2
Maytham Fahmi On

This happens when you try to run azd init from the solution folder.

It will give this error:

ERROR: only a single Aspire project is supported at this time

You need to change the directory to have the Aspire project which typically has a name convention ending with projectName.AppHost.

Then run it from there it will work.

As you can see in this project example I have taken snapshots of. There are multiple projects, and one project is Aspire which ends with AppHost.

enter image description here

Now I will switch to it cd WeatherApp.AppHost, and run azd init again, it works:

enter image description here

I can not defend the reason if this is made on purpose like this or if there is a bug in the command line.

Disclaimer: I have a simple aspire project working with azd command line example, you can check it on GitHub.