Rider shows lots of errors when opening an Unreal 5 project (but it sill builds)

When I open an Unreal 5 project in Rider, all the classes from UnrealBuildTool are shown as errors:

The type ‘object’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089’

But the game itself still builds. Only the parts that use UnrealBuildTool report errors. How to fix it?


enter image description here