Skip to content

Create custom .NET Aspire component #1355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jul 16, 2024

Conversation

IEvangelist
Copy link
Member

@IEvangelist IEvangelist commented Jul 12, 2024

Summary

  • WIP: Create custom .NET Aspire component

Fixes #5


Internal previews

📄 File 🔗 Preview link
docs/extensibility/custom-component.md docs/extensibility/custom-component
docs/extensibility/custom-resources.md docs/extensibility/custom-resources

@IEvangelist IEvangelist marked this pull request as ready for review July 16, 2024 13:00
@IEvangelist IEvangelist force-pushed the new-aspire-component branch from b6e5ae2 to 83524af Compare July 16, 2024 14:55
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is impressive. It's ready to :shipit:

@IEvangelist IEvangelist enabled auto-merge (squash) July 16, 2024 19:18
@IEvangelist IEvangelist merged commit 7d7daa7 into dotnet:main Jul 16, 2024
7 checks passed
Comment on lines +85 to +94
if (builder.Configuration.GetConnectionString(connectionName) is string connectionString)
{
settings.ParseConnectionString(connectionString);
}

if (builder.Configuration.GetSection(
$"{configurationSectionName}:Credentials") is { } section)
{
settings.ParseCredentials(section);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically we put this whole thing into the connection string, and not separate sections. That way there is only 1 "contract" between the Hosting piece and the Component libraries.

Also, that way you can have different credentials when you use a "keyed" service - if you had 2 mail connections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.NET Aspire tutorial: Create a new .NET Aspire component.
3 participants