visual-studioeditor

How to stop Visual Studio from putting extra newline at the end of a file on save


I'm using Visual Studio 2019, and when I save a file (a cs file for example) VS will put an extra newline at the of the file.

  1. I need to stop this behavior, but what I have searched on the internet so far, was about visual studio code or editors other than Visual Studio.
  2. What is the philosophy of putting an extra newline at the end of file?

Solution

  • According to this link, I need to make Advanced Save Options menu visible, and then click it and change line endings dropdown value from Current Settings to Windows (CR LF).