Hello Kelly Zhao,
Welcome to Microsoft Q&A forum.
Please set your MSBuild Project Build Output verbosity to Detailed. Then you can get the details of the build and see the error. (Main menu>Tools>Options>Projects and Solutions>Build And Run)
You can then follow these suggestions:
- Recreate the C++ project to check if the problem is a project-specific issue.
- Please check whether you have any warnings on your NuGet packages. If so, please reinstall them.
- If you have licenses.licx files, you should exclude them from your project.
- Use the Visual Studio installer to repair Visual Studio.
If you get a more detailed error in the build information, it will be more conducive to our analysis of the problem.
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.