What does Visual Studio mean by normalize inconsistent line endings?

What does Visual Studio mean by normalize inconsistent line endings?

What that usually means is that you have lines ending with something other than a carriage return/line feed pair. It often happens when you copy and paste from a web page into the code editor.

Normalizing the line endings is just making sure that all of the line ending characters are consistent. It prevents one line from ending in rn and another ending with r or n; the first is the Windows line end pair, while the others are typically used for Mac or Linux files.

Since youre developing in Visual Studio, youll obviously want to choose Windows from the drop down. 🙂

Some lines end with n.

Some other lines end with rn.

Visual Studio suggests you to make all lines end the same.

What does Visual Studio mean by normalize inconsistent line endings?

If you are using Visual Studio 2012:

Go to menu File → Advanced Save Options → select Line endings type as Windows (CR LF).

Leave a Reply

Your email address will not be published.