Hi Iman Biglari,
Welcome to Microsoft Q&A forum.
Here are some solutions to try.
Recreate a new project, and check if this issue appears in this newly created project. Please let me know if it is reproducible.
If the problem only occurs in a specific project:
1.Close Visual Studio and delete the .vs folder under the project folder and reopen Visual Studio to build the project.
2.Reinstall assembly Microsoft.Visual Studio.CodeCoverage.Shim
If this problem occurs in other projects, you can try repairing Visual Studio using the Visual Studio installer.
If the problem is still not resolved, you can set MSBuild build output verbosity to verbosity to get more detailed build information and errors.
Best Regards,
Zhengye
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.