如何阻止 Visual Studio 在保存时在文件末尾放置额外的换行符

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

我正在使用 Visual Studio 2019,当我保存文件(例如 cs 文件)时,VS 会在文件的开头添加一个额外的换行符。

  1. 我需要停止这种行为,但到目前为止我在互联网上搜索的是关于 visual studio codeVisual Studio 以外的编辑。
  2. 在文件末尾多加一个换行符的原理是什么?

根据this link,我需要使 Advanced Save Options 菜单可见,然后单击它并将 line endings 下拉值从 Current Settings 更改为Windows (CR LF).