If I want to write a CLI application... #4625
-
Is there any advice that I can follow so that the application can consume everything abstracted by Aspire? Like say I have a database and I want to run some maintenance tasks. Or maybe even use EFs migration bundling... (etc) 🙂 |
Beta Was this translation helpful? Give feedback.
Answered by
jack775544
Jun 24, 2024
Replies: 1 comment 3 replies
-
What do you mean exactly? That you want to write a cli application that uses the aspire components? Or something else? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From what I have seen, Aspire components are built using the
IHostApplicationBuilder
which is not limited to web apps, but can also be used for console apps. You can read more about how to use it for a console app here.If you want a short lived appplication, you can do something like this
Or if you want a long lived application, you can implement a hosted service and run the host instead of just building it.