Hi @Water Yue ,
Welcome to Microsoft Q&A!
What is your project type? Have you viewed the document: Disable code analysis?
Are you using an __EditorConfig __file to do a Code Cleanup? If an .editorconfig file exists for the project, those are the settings that take precedence.
You can go to Tools > Options > Text Editor > Code Cleanup > uncheck the “Run Code Cleanup profile on save”.
If it persists, please share us the detailed build result in Output window. You can also check them in a new project.
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.