Fix template configuration messages MV008 and MV011 in Aspire.ProjectTemplates#15827
Fix template configuration messages MV008 and MV011 in Aspire.ProjectTemplates#15827
Conversation
Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/8f375e98-ea2c-447b-85fb-56dec202f12f Co-authored-by: radical <1472+radical@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15827Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15827" |
|
@copilot This did not fix the messages. They don't show up as warnings. They are messages in the build when building the ProjectTemplates. |
Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/2450c501-6206-4a33-8459-960d39e45c57 Co-authored-by: radical <1472+radical@users.noreply.github.com>
Fixed in 35ca453. The actual issue was in the template.json files under
The build now succeeds with 0 warnings, 0 errors, and no MV008/MV011 messages. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot how can we detect such issues in the future? Does the template generation or targets support making these errors? |
The The task has only one documented parameter ( For future detection, the best option currently is to add a custom target in The most practical approaches are:
The current fix ensures the messages don't appear, and adding Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
This PR addresses Microsoft.TemplateEngine.Authoring.Tasks validation messages (MV008/MV011) emitted when building Aspire.ProjectTemplates by updating template metadata, and aligns Aspire CLI output with the existing localization approach by moving a few hardcoded NuGet.config messages into TemplatingStrings resources.
Changes:
- Add
generatorVersions: "1.0.0.0"to all runnable project templates to satisfy MV008. - Fix MV011 by changing
manualInstructionsfrom an empty array to an object array (with a default entry) for VS-onlyset-startup-projectpost-actions, and update all template localization JSONs accordingly. - Extract three NuGet.config prompt/confirmation strings in
NuGetConfigPrompterintoTemplatingStrings.resxand update the corresponding XLF files.
Reviewed changes
Copilot reviewed 80 out of 81 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Aspire.ProjectTemplates/templates/aspire-apphost/.template.config/template.json | Add generatorVersions; fix manualInstructions structure for VS-only post action. |
| src/Aspire.ProjectTemplates/templates/aspire-apphost/.template.config/localize/templatestrings.cs.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-apphost/.template.config/localize/templatestrings.de.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-apphost/.template.config/localize/templatestrings.en.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-apphost/.template.config/localize/templatestrings.es.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-apphost/.template.config/localize/templatestrings.fr.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-apphost/.template.config/localize/templatestrings.it.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-apphost/.template.config/localize/templatestrings.ja.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-apphost/.template.config/localize/templatestrings.ko.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-apphost/.template.config/localize/templatestrings.pl.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-apphost/.template.config/localize/templatestrings.pt-BR.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-apphost/.template.config/localize/templatestrings.ru.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-apphost/.template.config/localize/templatestrings.tr.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-apphost/.template.config/localize/templatestrings.zh-Hans.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-apphost/.template.config/localize/templatestrings.zh-Hant.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-apphost-singlefile/.template.config/template.json | Add generatorVersions to satisfy MV008. |
| src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/template.json | Add generatorVersions; fix manualInstructions structure for VS-only post action. |
| src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/localize/templatestrings.cs.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/localize/templatestrings.de.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/localize/templatestrings.en.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/localize/templatestrings.es.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/localize/templatestrings.fr.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/localize/templatestrings.it.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/localize/templatestrings.ja.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/localize/templatestrings.ko.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/localize/templatestrings.pl.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/localize/templatestrings.pt-BR.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/localize/templatestrings.ru.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/localize/templatestrings.tr.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/localize/templatestrings.zh-Hans.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-empty/.template.config/localize/templatestrings.zh-Hant.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-mstest/.template.config/template.json | Add generatorVersions to satisfy MV008. |
| src/Aspire.ProjectTemplates/templates/aspire-nunit/.template.config/template.json | Add generatorVersions to satisfy MV008. |
| src/Aspire.ProjectTemplates/templates/aspire-servicedefaults/.template.config/template.json | Add generatorVersions to satisfy MV008. |
| src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/template.json | Add generatorVersions; fix manualInstructions structure for VS-only post action. |
| src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/localize/templatestrings.cs.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/localize/templatestrings.de.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/localize/templatestrings.en.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/localize/templatestrings.es.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/localize/templatestrings.fr.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/localize/templatestrings.it.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/localize/templatestrings.ja.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/localize/templatestrings.ko.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/localize/templatestrings.pl.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/localize/templatestrings.pt-BR.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/localize/templatestrings.ru.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/localize/templatestrings.tr.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/localize/templatestrings.zh-Hans.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-starter/.template.config/localize/templatestrings.zh-Hant.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/.template.config/template.json | Add generatorVersions; fix manualInstructions structure for VS-only post action. |
| src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/.template.config/localize/templatestrings.cs.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/.template.config/localize/templatestrings.de.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/.template.config/localize/templatestrings.en.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/.template.config/localize/templatestrings.es.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/.template.config/localize/templatestrings.fr.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/.template.config/localize/templatestrings.it.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/.template.config/localize/templatestrings.ja.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/.template.config/localize/templatestrings.ko.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/.template.config/localize/templatestrings.pl.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/.template.config/localize/templatestrings.pt-BR.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/.template.config/localize/templatestrings.ru.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/.template.config/localize/templatestrings.tr.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/.template.config/localize/templatestrings.zh-Hans.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-ts-cs-starter/.template.config/localize/templatestrings.zh-Hant.json | Add localized key for default manual instructions (empty text). |
| src/Aspire.ProjectTemplates/templates/aspire-xunit/.template.config/template.json | Add generatorVersions to satisfy MV008. |
| src/Aspire.Cli/Packaging/NuGetConfigPrompter.cs | Replace hardcoded prompt/confirmation strings with localized TemplatingStrings resources. |
| src/Aspire.Cli/Resources/TemplatingStrings.resx | Add three new localized strings used by NuGetConfigPrompter. |
| src/Aspire.Cli/Resources/TemplatingStrings.Designer.cs | Regenerate strongly-typed resource accessors for new strings. |
| src/Aspire.Cli/Resources/xlf/TemplatingStrings.cs.xlf | Add new trans-units for NuGet.config messages. |
| src/Aspire.Cli/Resources/xlf/TemplatingStrings.de.xlf | Add new trans-units for NuGet.config messages. |
| src/Aspire.Cli/Resources/xlf/TemplatingStrings.es.xlf | Add new trans-units for NuGet.config messages. |
| src/Aspire.Cli/Resources/xlf/TemplatingStrings.fr.xlf | Add new trans-units for NuGet.config messages. |
| src/Aspire.Cli/Resources/xlf/TemplatingStrings.it.xlf | Add new trans-units for NuGet.config messages. |
| src/Aspire.Cli/Resources/xlf/TemplatingStrings.ja.xlf | Add new trans-units for NuGet.config messages. |
| src/Aspire.Cli/Resources/xlf/TemplatingStrings.ko.xlf | Add new trans-units for NuGet.config messages. |
| src/Aspire.Cli/Resources/xlf/TemplatingStrings.pl.xlf | Add new trans-units for NuGet.config messages. |
| src/Aspire.Cli/Resources/xlf/TemplatingStrings.pt-BR.xlf | Add new trans-units for NuGet.config messages. |
| src/Aspire.Cli/Resources/xlf/TemplatingStrings.ru.xlf | Add new trans-units for NuGet.config messages. |
| src/Aspire.Cli/Resources/xlf/TemplatingStrings.tr.xlf | Add new trans-units for NuGet.config messages. |
| src/Aspire.Cli/Resources/xlf/TemplatingStrings.zh-Hans.xlf | Add new trans-units for NuGet.config messages. |
| src/Aspire.Cli/Resources/xlf/TemplatingStrings.zh-Hant.xlf | Add new trans-units for NuGet.config messages. |
Files not reviewed (1)
- src/Aspire.Cli/Resources/TemplatingStrings.Designer.cs: Language not supported
Description
Fixes template engine validation messages that appear when building
Aspire.ProjectTemplates.csproj:Missing 'generatorVersions'): Added"generatorVersions": "1.0.0.0"to all 9template.jsonfiles undersrc/Aspire.ProjectTemplates/templates/. This is the version of theRunnableProjectGeneratorthat all .NET templates target.malformed or missing manualInstructions): Replaced empty"manualInstructions": []with"manualInstructions": [{ "text": "" }]in 4 templates (aspire-apphost,aspire-empty,aspire-starter,aspire-ts-cs-starter) that have a VS-onlyset-startup-projectpost-action with no CLI equivalent instructions.Localization files (
templatestrings.*.json) were auto-updated by the build to include the new empty manual instructions entry.Additionally, three hardcoded English strings in
NuGetConfigPrompter.cswere extracted intoTemplatingStrings.resxas localized resource strings (UpdateNuGetConfigConfirmation,NuGetConfigUpdatedConfirmationMessage,NuGetConfigCreatedOrUpdatedConfirmationMessage), consistent with the rest of the CLI's message handling. All xlf translation files were updated viadotnet build /t:UpdateXlf.Note: The
ValidateTemplatestask (fromMicrosoft.TemplateEngine.Authoring.Tasks) logs MV008/MV011 as MSBuild informational messages rather than warnings or errors, so they are not surfaced as build failures by default. The task has only one documented parameter (TemplateLocation) with no built-in option to promote these messages to errors. Future issues of this kind will be visible in build output on every build sinceValidateTemplatesruns by default.Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: