Hi @志毓 石,
Welcome to Microsoft Q&A!
Are you using VS2022? Do you have any error messages or warnings?
Please create a new project and check that it works properly.
You can try the following workarounds:
- Open Visual Studio Installer > More > Repair the VS.
- Run “devenv /ResetSettings” at Developer Command Prompt to restore your Visual Studio default settings.
- Close VS and manually delete the hidden .vs folder in the project folder.
- If you have anti-virus software, please temporarily disable it.
- Please check your System environment variables if there are two paths to dotnet.
C:\Porgram Files (x86)\dotnet
If you can find them, please click on the Move up button to move the entry C:\Program Files\dotnet before the x86 one.
Or delete this one: C:\Porgram Files (x86)\dotnet.
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.