Visual Studio 2022 builds and runs UE5.0

Getting error MSB3073 (microsoft.com)

There are two problems the path length of your local repository is too long
mine was originally c:\user\owner\source\repos\ue50-release-test-local.
this means that when the batch builder tries to make the file it becomes
c:\user\owner\source\repos\ue50-release-test-local\Engine\Binaries\msbdatetime2022.bat.
That now hits an old limit set by windows.
I am now using c:\user\owner\ue50 and this seem to work

Second, if your Appdata directory is hidden this will fail as it needs to create
Appdata\UnrealEngine directory and there will be a domain protection error in Windows Professional