-
Notifications
You must be signed in to change notification settings - Fork 736
Add .NET MAUI Service Defaults template #13001
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
base: main
Are you sure you want to change the base?
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13001Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13001" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the .NET MAUI-specific Service Defaults template from the MAUI repository to the Aspire repository. The template provides a service defaults implementation tailored for MAUI applications, including OpenTelemetry instrumentation, service discovery, and resilience handlers specifically configured for mobile scenarios.
Key Changes
- Adds a new
maui-aspire-servicedefaultsproject template with MAUI-specific service defaults - Implements OpenTelemetry providers initialization via
IMauiInitializeServicefor MAUI applications - Includes test coverage for the new template with Aspire version 13.0
- Updates CODEOWNERS to assign ownership to the MAUI maintainer
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/Aspire.ProjectTemplates/templates/aspire-maui-servicedefaults/.template.config/template.json |
Template configuration defining the MAUI service defaults template with version 13.0 support |
src/Aspire.ProjectTemplates/templates/aspire-maui-servicedefaults/13.0/MauiAspire.ServiceDefaults1.csproj |
Project file with MAUI-specific package references and OpenTelemetry dependencies |
src/Aspire.ProjectTemplates/templates/aspire-maui-servicedefaults/13.0/Extensions.cs |
Service defaults implementation with MAUI-specific OpenTelemetry initialization |
src/Aspire.ProjectTemplates/templates/aspire-maui-servicedefaults/.template.config/localize/templatestrings.en.json |
Localization strings for the template |
src/Aspire.ProjectTemplates/templates/aspire-maui-servicedefaults/.template.config/ide.host.json |
IDE integration configuration for Visual Studio |
src/Aspire.ProjectTemplates/templates/aspire-maui-servicedefaults/.template.config/dotnetcli.host.json |
CLI configuration for command-line usage |
src/Aspire.ProjectTemplates/templates/aspire-maui-servicedefaults/.template.config/ide/AspireServiceDefaults.ico |
Template icon file |
tests/Aspire.Templates.Tests/NewUpAndBuildSupportProjectTemplatesTests.cs |
Test class to verify the template can be instantiated and built |
.github/CODEOWNERS |
Assigns ownership of the MAUI service defaults template |
src/Aspire.ProjectTemplates/templates/aspire-maui-servicedefaults/13.0/Extensions.cs
Outdated
Show resolved
Hide resolved
…lts/13.0/Extensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.Maui.Core" Version="10.0.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this version stay up to date?
| services.GetService<MeterProvider>(); | ||
| services.GetService<TracerProvider>(); | ||
| services.GetService<LoggerProvider>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is kind of odd IMO. We need to ensure these services are activated? It almost feels like this requires a comment, or should be in fixed elsewhere.
Moving over the MAUI specific service defaults from the .NET MAUI repository to here.
I think it makes more sense to keep them here so that changes in these templates are also automatically caught, instead of trying to keep it in sync over 2 repositories.
I did keep the short name the same as it is in the MAUI repo right now. That is
maui-aspire-servicedefaultsas opposed toaspire-maui-servicedefaultswhich probably makes more sense. This to make sure there's not a breaking change for people that might be using this right now, although its still early days and preview so if you have strong opinions I'm happy to change it around.