Modernizing Legacy ASP.NET? Don't Fall Into the Task.Run Trap.
When you're building new async controllers and services but your repositories are still synchronous.
Don't wrap sync calls in Task.Run!
You'll burn two thread pool threads instead of one.
Tired of wrestling with AWS or Azure just to deploy a side project? 😅
I found my sweet spot — Render.
I've been using it to deploy all my portfolio projects and honestly, it's been a game changer. No complex IAM roles, no billing surprises, no 47-step setup guides.
When modernizing legacy .NET apps, I often see this pattern:
“Let’s wrap the sync code in Task.Run () and await it.”
-> It looks async.
-> It compiles async.
-> But it’s fake async.
What really happens:
-> Blocking I/O is moved to the ThreadPool
-> Threads are still consumed
->...
Ever had a bug that only showed up in production and refused to reproduce locally?
I just wrote about a real EF Core footgun where a “harmless getter” silently corrupted lookup tables and left developers scratching their heads.
I try to explain how tracking, SaveChanges(), and...