{"slug": "this-week-in-cursor-net-7-rules-week-ending-august-30-2026", "title": "This week in Cursor + .NET — 7 rules (week ending August 30, 2026)", "summary": "A developer published a weekly digest of seven rules for senior C#/.NET engineers using Cursor, covering topics such as avoiding Singleton holding Scoped services, forwarding CancellationToken in async methods, and using IHttpClientFactory instead of new HttpClient(). The rules aim to prevent common runtime bugs and improve code quality in AI-assisted development.", "body_md": "*Every weekday a single, opinionated rule for senior C#/.NET engineers using Cursor. Here's the full week in one read — canonical posts live on the Agentic Architect blog.*\n\n*Sun 30 Aug*\n\nThe single most expensive .NET runtime bug: a Singleton holding a Scoped service. Cursor cheerfully writes this without warning. Audit constructor parameters of any class registered as Singleton — if any are typically Scoped (DbContext, repositories, MediatR sender), flag it before merge.\n\n*Sat 29 Aug*\n\nEvery async method in your codebase should accept and forward a CancellationToken. Make it a rule that any new async signature without one is flagged. Stops the AI from quietly losing cancellation half-way down a call chain.\n\n*Fri 28 Aug*\n\nRefuse new HttpClient() in any generated code. Force Cursor to inject IHttpClientFactory or a typed client. The classic socket-exhaustion bug is exactly the kind of footgun an AI hands you without realising.\n\n*Thu 27 Aug*\n\nNever let Cursor hardcode DateTime.Now or DateTime.UtcNow in business logic. Inject TimeProvider (or your own IClock) instead. This makes time deterministic for tests and stops the AI reaching for static APIs whenever it generates time-aware code.\n\n*Wed 26 Aug*\n\nUse MapGroup and EndPoints for .NET 9 services. It keeps the context window lean and focused, helping the AI provide more accurate code suggestions than it can with massive, bloated Controllers.\n\n*Tue 25 Aug*\n\nEvery MediatR Request must have a FluentValidation rule. Force the AI to check the validator before writing handler logic. This prevents \"context rot\" where the AI forgets your business constraints.\n\n*Mon 24 Aug*\n\nEnforce ILogger with structured templates. Never use string interpolation in logs. This ensures that when you feed logs back into Cursor for debugging, the AI recognizes the patterns immediately.\n\nThe free is one drop-in Cursor rule that ends the morning re-explanation ritual. Install in 60 seconds, see whether Cursor actually remembers your DI lifetimes, and decide for yourself whether the full kit is worth £9.00.\n\n`arch-core-lite.mdc`\n\n`arch-core-lite.mdc`\n\non GitHubCanonical home for everything in this digest: [https://agentic-architect.dev/blog/](https://agentic-architect.dev/blog/).", "url": "https://wpnews.pro/news/this-week-in-cursor-net-7-rules-week-ending-august-30-2026", "canonical_source": "https://dev.to/agentic_architect/this-week-in-cursor-net-7-rules-week-ending-august-30-2026-3ono", "published_at": "2026-08-30 14:52:16+00:00", "updated_at": "2026-08-30 15:24:26.944493+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools"], "entities": ["Cursor", ".NET", "Agentic Architect", "MediatR", "FluentValidation", "IHttpClientFactory", "TimeProvider"], "alternates": {"html": "https://wpnews.pro/news/this-week-in-cursor-net-7-rules-week-ending-august-30-2026", "markdown": "https://wpnews.pro/news/this-week-in-cursor-net-7-rules-week-ending-august-30-2026.md", "text": "https://wpnews.pro/news/this-week-in-cursor-net-7-rules-week-ending-august-30-2026.txt", "jsonld": "https://wpnews.pro/news/this-week-in-cursor-net-7-rules-week-ending-august-30-2026.jsonld"}}