Hello @Vladimir Kolmogorov ,
Welcome to Microsoft Q&A forum.
If you try to change to create a new project and save it in another directory, maybe in other drive, and then add a .cpp file, will the same error appear?
If the same error still appears, please try to close VS > open VS Installer > More > click Repair to repair VS. Also try to run devenv /ResetSettings in VS Developer Command Prompt to reset VS settings.
If the same error doesn’t appear, please check if there’s any limitation or special configuration on that drive/directory.
Besides, please try to run VS as administrator.
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.