No problem here in Rider, so I'm assuming your Rider install isn't following along.
Make sure you're on version 2025.3.* - which version are you on now?
An AI says you could try:
1. Invalidate Rider's cache: File → Invalidate Caches → Invalidate and Restart
2. Ensure Rider uses the correct SDK: File → Settings → Build, Execution, Deployment → Toolset and Build → Use MSBuild version: ".NET SDK"
3. Enable source generators: File → Settings → Build, Execution, Deployment → Build Tools → Enable source generators
4. Rebuild solution: Right-click solution → Clean Solution, then Rebuild Solution