isaranghi
isaranghi

Reputation: 315

.Net Aspire components vs regular components

I have a few existing microservices written in .NET. I recently came across .NET Aspire. Currently, in my microservices, I am using non-Aspire packages, for example, “Npgsql.EntityFrameworkCore.PostgreSQL”. I understand that when using Aspire, in the AppHost project, I will have to use Aspire components like “Aspire.Npgsql.EntityFrameworkCore.PostgreSQL”. However, in my microservices, do I need to change my packages to “Aspire.Npgsql.EntityFrameworkCore.PostgreSQL”? I know my microservices would work with the non-Aspire packages, but is there any advantage to using Aspire-specific packages in microservices?

Ideally, I would like to keep all the microservices independent of Aspire.

Thanks

Upvotes: 1

Views: 143

Answers (1)

davidfowl
davidfowl

Reputation: 38814

However, in my microservices, do I need to change my packages to “Aspire.Npgsql.EntityFrameworkCore.PostgreSQL”? I know my microservices would work with the non-Aspire packages, but is there any advantage to using Aspire-specific packages in microservices? Ideally, I would like to keep all the microservices independent of Aspire. Thanks

You don't have to use them, you can replicate what they do if you want to manually wire up telemetry, resiliency, configuration, and authentication and DI for each of your client libraries.

Components are very lightweight, and you should use them in your microservices.

PS: I recommend watching https://youtu.be/istmgTDtSSQ to get more insight into what is being provided for you.

Upvotes: 1

Related Questions