Commit 239cf6d
Prefer identity channel for DotNet template resolution
The cherry-picks of #17564 and #17573 alone do not address the
`aspire new` + C# Blazor scenario from #17596 because that path
runs through `TemplateNuGetConfigService.ResolveTemplatePackageAsync`
(DotNet templates), not `NewCommand.ResolveCliTemplateVersionAsync`
(CLI-runtime templates) where #17564's `TryGetCurrentCliTemplateVersionPackage`
synthesis lives.
Teach `ResolveTemplatePackageAsync` to mirror the identity-channel
preference that `ResolveCliTemplateVersionAsync` (NewCommand.cs:376-389)
already does for CLI templates: when no `--channel` is supplied and no
PR hives exist, prefer the channel whose name matches the running CLI's
`CliExecutionContext.IdentityChannel` before falling back to Implicit.
Without this, a daily 13.5 CLI on a clean `~/.aspire` silently restricts
the template search to nuget.org and returns the shipped stable
`Aspire.ProjectTemplates 13.3.5` instead of the matching
`13.5.0-preview.1.*` daily prerelease from the `dotnet9` feed.
The Implicit fallback preserves prior behavior when the identity channel
isn't a registered channel (e.g. a "local" CLI without a corresponding
local-build hive).
See #17596 for full repro.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 58b3c85 commit 239cf6d
2 files changed
Lines changed: 101 additions & 9 deletions
File tree
- src/Aspire.Cli/Templating
- tests/Aspire.Cli.Tests/Templating
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
227 | 233 | | |
228 | 234 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
234 | 265 | | |
235 | 266 | | |
236 | 267 | | |
| |||
Lines changed: 65 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
| 215 | + | |
216 | 216 | | |
217 | | - | |
218 | | - | |
219 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
220 | 224 | | |
221 | 225 | | |
222 | 226 | | |
| |||
247 | 251 | | |
248 | 252 | | |
249 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
250 | 311 | | |
251 | 312 | | |
252 | 313 | | |
| |||
0 commit comments