Skip to content

Commit 42e91f5

Browse files
committed
Upgrade to .NET 10.0, Aspire 13.x, and modernize infra
Upgraded all projects to .NET 10.0 and updated NuGet dependencies. Migrated Aspire AppHost to SDK 13.x with new SQL Server resource wiring and global.json pinning. Refactored Store ProductService for simpler image URL handling and added image caching. Introduced /api/images/{id} endpoint in Store for product image serving. Restored Cart/Checkout link in navigation and enabled Blazor interactive rendering for Checkout. Updated tests, benchmarks, and documentation. Added AGENTS.md, copilot_instructions.md, and improved scenario/task tracking.
1 parent e4b6e26 commit 42e91f5

21 files changed

Lines changed: 211 additions & 69 deletions

File tree

.aspire/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"appHostPath": "../src/TinyShop.AppHost/TinyShop.AppHost.csproj"
3+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
# Workflow Orchestration
3+
4+
## 1. Plan Node Default
5+
- Enter plan mode for ANY non-trivial task (3+ steps or architectural decisions)
6+
- If something goes sideways, STOP and re-plan immediately - don't keep pushing
7+
- Use plan mode for verification steps, not just building
8+
- Write detailed specs upfront to reduce ambiguity
9+
10+
## 2. Subagent Strategy
11+
- Use subagents liberally to keep main context window clean
12+
- Offload research, exploration, and parallel analysis to subagents
13+
- For complex problems, throw more compute via subagents
14+
- One task per subagent for focused execution
15+
16+
## 3. Self-Improvement Loop
17+
- After ANY correction from the user: update `workflows/lessons.md` with the pattern
18+
- Write rules for yourself that prevent the same mistake
19+
- Ruthlessly iterate on these lessons until mistake rate drops
20+
- Review lessons at session start for relevant project
21+
22+
## 4. Verification Before Done
23+
- Never mark a task complete without proving it works
24+
- Diff behavior between main and your changes when relevant
25+
- Ask yourself: "Would a staff engineer approve this?"
26+
- Run tests, check logs, demonstrate correctness
27+
28+
## 5. Demand Elegance (Balanced)
29+
- For non-trivial changes: pause and ask "Is there a more elegant way?"
30+
- If a fix feels hacky: acknowledge it and implement the cleaner solution
31+
- Skip fixes for simple, obvious fixes - don't over-engineer and focus on correctness first
32+
- Challenge your own work before presenting it
33+
34+
## 6. Autonomous Bug Fixing
35+
- When given a bug report: just fix it. Don't ask for hand-holding
36+
- Point to logs, errors, failing tests - then resolve them
37+
- Zero context switching required from the user
38+
- Go fix failing CI tests without being told how
39+
40+
## 7. Task Management
41+
1. **Plan First**: Write plan to `workflows/todo.md` with checkable items
42+
2. **Verify Plans**: Check plan before starting implementation
43+
3. **Track Progress**: Mark items complete as you go
44+
4. **Explain Changes**: High-level summary at each step
45+
5. **Document Lessons**: Add review section to `workflows/todo.md`
46+
6. **Capture Lessons**: Update `workflows/lessons.md` after corrections
47+
48+
## Core Principles
49+
- **Simplicity First**: Make every change as simple as possible. Impact minimal code.
50+
- **No Laziness**: Find root causes, not temporary fixes. Senior developer standards.
51+
- **Minimal Impact**: Changes should only touch what's necessary. Avoid introducing bugs.

.github/upgrades/scenarios/new-dotnet-version_9488f4/scenario.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"operationId": "9488f4f1-bf3e-4e63-90e5-497fed7a2577",
44
"description": "Upgrade solution or project to new version of .NET",
55
"startTime": "2026-02-22T20:42:33.6358209Z",
6-
"lastUpdateTime": "2026-02-22T21:14:29.2279666Z",
6+
"lastUpdateTime": "2026-03-07T11:38:22.5815998Z",
77
"stage": "Execution",
88
"properties": {},
99
"folderPath": ""

.github/upgrades/scenarios/new-dotnet-version_9488f4/tasks.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,37 @@
44

55
This document tracks the execution of the TinyShop solution upgrade from .NET 9.0 to .NET 10.0. All projects will be upgraded simultaneously in a single atomic operation, followed by verification.
66

7-
**Progress**: 0/2 tasks complete (0%) ![0%](https://progress-bar.xyz/0)
7+
**Progress**: 1/2 tasks complete (50%) ![0%](https://progress-bar.xyz/50)
88

99
---
1010

1111
## Tasks
1212

13-
### [] TASK-001: Verify prerequisites
13+
### [] TASK-001: Verify prerequisites *(Completed: 2026-02-22 21:15)*
1414
**References**: Plan §Migration Strategy - Execution Steps
1515

16-
- [] (1) Verify .NET 10.0 SDK installed per Plan §Executive Summary
17-
- [ ] (2) .NET 10.0 SDK is available (**Verify**)
18-
- [ ] (3) Check global.json compatibility (if present in repository)
19-
- [ ] (4) global.json compatible with .NET 10.0 or updated (**Verify**)
16+
- [] (1) Verify .NET 10.0 SDK installed per Plan §Executive Summary
17+
- [] (2) .NET 10.0 SDK is available (**Verify**)
18+
- [] (3) Check global.json compatibility (if present in repository)
19+
- [] (4) global.json compatible with .NET 10.0 or updated (**Verify**)
2020

2121
---
2222

23-
### [ ] TASK-002: Atomic framework and package upgrade for all projects
23+
### [] TASK-002: Atomic framework and package upgrade for all projects
2424
**References**: Plan §Migration Strategy - Execution Steps, Plan §Detailed Dependency Analysis - NuGet Package Dependencies, Plan §Risk Management - Critical Issues
2525

26-
- [ ] (1) Update TargetFramework to net10.0 in all 5 projects: DataEntities, TinyShop.ServiceDefaults, Products, Store, BenchmarkSuite1 per Plan §Migration Strategy - Upgrade Sequence
27-
- [ ] (2) All project TargetFramework properties updated to net10.0 (**Verify**)
28-
- [ ] (3) Update package references per Plan §Detailed Dependency Analysis - NuGet Package Dependencies (10 packages: Microsoft.EntityFrameworkCore 9.0.6→10.0.3, Microsoft.EntityFrameworkCore.Design 9.0.6→10.0.3, Microsoft.Extensions.Http.Resilience 9.6.0→10.3.0, Microsoft.Extensions.ServiceDiscovery 9.3.1→10.3.0, Microsoft.VisualStudio.Web.CodeGeneration.Design 9.0.0→10.0.2, OpenTelemetry.Instrumentation.AspNetCore 1.12.0→1.15.0, OpenTelemetry.Instrumentation.Http 1.12.0→1.15.0, System.Formats.Asn1 9.0.6→10.0.3, System.Text.Json 9.0.6→10.0.3)
29-
- [ ] (4) All package references updated (**Verify**)
30-
- [ ] (5) Restore all dependencies
31-
- [ ] (6) All dependencies restored successfully (**Verify**)
32-
- [ ] (7) Build solution and fix all compilation errors per Plan §Risk Management - Critical Issues (focus on Store project: fix TimeSpan.FromMinutes(5) to TimeSpan.FromMinutes(5.0) at Store\Services\ProductService.cs line 31)
33-
- [ ] (8) Solution builds with 0 errors (**Verify**)
34-
- [ ] (9) Commit changes with message: "TASK-002: Complete .NET 10.0 atomic upgrade for all projects"
26+
- [] (1) Update TargetFramework to net10.0 in all 5 projects: DataEntities, TinyShop.ServiceDefaults, Products, Store, BenchmarkSuite1 per Plan §Migration Strategy - Upgrade Sequence
27+
- [] (2) All project TargetFramework properties updated to net10.0 (**Verify**)
28+
- [] (3) Update package references per Plan §Detailed Dependency Analysis - NuGet Package Dependencies (10 packages: Microsoft.EntityFrameworkCore 9.0.6→10.0.3, Microsoft.EntityFrameworkCore.Design 9.0.6→10.0.3, Microsoft.Extensions.Http.Resilience 9.6.0→10.3.0, Microsoft.Extensions.ServiceDiscovery 9.3.1→10.3.0, Microsoft.VisualStudio.Web.CodeGeneration.Design 9.0.0→10.0.2, OpenTelemetry.Instrumentation.AspNetCore 1.12.0→1.15.0, OpenTelemetry.Instrumentation.Http 1.12.0→1.15.0, System.Formats.Asn1 9.0.6→10.0.3, System.Text.Json 9.0.6→10.0.3)
29+
- [] (4) All package references updated (**Verify**)
30+
- [] (5) Restore all dependencies
31+
- [] (6) All dependencies restored successfully (**Verify**)
32+
- [] (7) Build solution and fix all compilation errors per Plan §Risk Management - Critical Issues (focus on Store project: fix TimeSpan.FromMinutes(5) to TimeSpan.FromMinutes(5.0) at Store\Services\ProductService.cs line 31)
33+
- [] (8) Solution builds with 0 errors (**Verify**)
34+
- [] (9) Commit changes with message: "TASK-002: Complete .NET 10.0 atomic upgrade for all projects"
3535

3636
---
37+
38+
39+
40+

AGENTS.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Copilot instructions
2+
3+
This repository is set up to use Aspire. Aspire is an orchestrator for the entire application and will take care of configuring dependencies, building, and running the application. The resources that make up the application are defined in `apphost.cs` including application code and external dependencies.
4+
5+
## General recommendations for working with Aspire
6+
1. Before making any changes always run the apphost using `aspire run` and inspect the state of resources to make sure you are building from a known state.
7+
1. Changes to the _apphost.cs_ file will require a restart of the application to take effect.
8+
2. Make changes incrementally and run the aspire application using the `aspire run` command to validate changes.
9+
3. Use the Aspire MCP tools to check the status of resources and debug issues.
10+
11+
## Running the application
12+
To run the application run the following command:
13+
14+
```
15+
aspire run
16+
```
17+
18+
If there is already an instance of the application running it will prompt to stop the existing instance. You only need to restart the application if code in `apphost.cs` is changed, but if you experience problems it can be useful to reset everything to the starting state.
19+
20+
## Checking resources
21+
To check the status of resources defined in the app model use the _list resources_ tool. This will show you the current state of each resource and if there are any issues. If a resource is not running as expected you can use the _execute resource command_ tool to restart it or perform other actions.
22+
23+
## Listing integrations
24+
IMPORTANT! When a user asks you to add a resource to the app model you should first use the _list integrations_ tool to get a list of the current versions of all the available integrations. You should try to use the version of the integration which aligns with the version of the Aspire.AppHost.Sdk. Some integration versions may have a preview suffix. Once you have identified the correct integration you should always use the _get integration docs_ tool to fetch the latest documentation for the integration and follow the links to get additional guidance.
25+
26+
## Debugging issues
27+
IMPORTANT! Aspire is designed to capture rich logs and telemetry for all resources defined in the app model. Use the following diagnostic tools when debugging issues with the application before making changes to make sure you are focusing on the right things.
28+
29+
1. _list structured logs_; use this tool to get details about structured logs.
30+
2. _list console logs_; use this tool to get details about console logs.
31+
3. _list traces_; use this tool to get details about traces.
32+
4. _list trace structured logs_; use this tool to get logs related to a trace
33+
34+
## Other Aspire MCP tools
35+
36+
1. _select apphost_; use this tool if working with multiple app hosts within a workspace.
37+
2. _list apphosts_; use this tool to get details about active app hosts.
38+
39+
## Playwright MCP server
40+
41+
The playwright MCP server has also been configured in this repository and you should use it to perform functional investigations of the resources defined in the app model as you work on the codebase. To get endpoints that can be used for navigation using the playwright MCP server use the list resources tool.
42+
43+
## Updating the app host
44+
The user may request that you update the Aspire apphost. You can do this using the `aspire update` command. This will update the apphost to the latest version and some of the Aspire specific packages in referenced projects, however you may need to manually update other packages in the solution to ensure compatibility. You can consider using the `dotnet-outdated` with the users consent. To install the `dotnet-outdated` tool use the following command:
45+
46+
```
47+
dotnet tool install --global dotnet-outdated-tool
48+
```
49+
50+
## Persistent containers
51+
IMPORTANT! Consider avoiding persistent containers early during development to avoid creating state management issues when restarting the app.
52+
53+
## Aspire workload
54+
IMPORTANT! The aspire workload is obsolete. You should never attempt to install or use the Aspire workload.
55+
56+
## Official documentation
57+
IMPORTANT! Always prefer official documentation when available. The following sites contain the official documentation for Aspire and related components
58+
59+
1. https://aspire.dev
60+
2. https://learn.microsoft.com/dotnet/aspire
61+
3. https://nuget.org (for specific integration package details)

src/BenchmarkSuite1/BenchmarkSuite1.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="BenchmarkDotNet" Version="0.15.2" />
10-
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.3" />
11-
<PackageReference Include="Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers" Version="18.3.36726.2" />
9+
<PackageReference Include="BenchmarkDotNet" Version="0.15.8" />
10+
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.5" />
11+
<PackageReference Include="Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers" Version="18.6.37110.2" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

src/Products/Products.csproj

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111
<None Remove="Database.db-wal" />
1212
</ItemGroup>
1313
<ItemGroup>
14-
<PackageReference Include="System.Text.Json" Version="10.0.3" />
15-
<PackageReference Include="System.Formats.Asn1" Version="10.0.3" />
16-
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.3" />
17-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.3" />
18-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.3">
14+
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.5" />
15+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.5" />
16+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.5" />
17+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.5">
1918
<PrivateAssets>all</PrivateAssets>
2019
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2120
</PackageReference>

src/Products/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
builder.AddServiceDefaults();
88

99
// Configure SQL Server connection
10-
var connectionString = builder.Configuration.GetConnectionString("ProductsDb")
10+
var connectionString = builder.Configuration.GetConnectionString("productsdb")
1111
?? "Server=(localdb)\\MSSQLLocalDB;Database=TestDB;Integrated Security=true;TrustServerCertificate=True;";
1212

1313
builder.Services.AddDbContext<ProductDataContext>(options =>

src/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Overview
44

5-
TinyShop is a .NET 9 e-commerce application with:
5+
TinyShop is a .NET 10 e-commerce application with:
66
- **Products API**: Backend API serving product data and images
77
- **Store**: Blazor Server frontend for product browsing
88

src/Store.Tests/Store.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<IsPackable>false</IsPackable>

0 commit comments

Comments
 (0)