Hi @An Thuyen,
Welcome to Microsoft Q&A!
Does your VS work before? Could you tell us how you change the path in variables?
To confirm it again, please search "Edit the system environment variables" in Windows Search box > Open it > Environment Variables… > ensure you select System variables not User variables > select Path > Edit….
Besides, please check your System environment variables if there is the following path to dotnet:
C:\Program Files\dotnet
You can try to launch your Visual Studio 2022 in Safe Mode (run devenv /SafeMode in Developer Command Prompt for VS 2022) and check that the project is created properly.
Sincerely,
Anna
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.