Uninstall Rider
Have you Install Rider? I have this problem too.
I install Rider before,I think Rider maybe not support to edit UE5 temporary,So I uninstall Rider,and I run UE5 successfully,I also install Visual Studio,you could have a try,just uninstall Rider