13

I'm new to VS, never really used it much. Prefer other IDE's but when it's a toss up between VS and MonoDevelop, I was told VS was the better choice.

I set it as my default editor in Unity and it's giving me this message every so often

The line endings in this file are not consistent. Do you want to normalize the endings?

Then it gives me a list such as

Windows (CR LF) Macintosh (CR) Unix (LF)

How can I stop this from coming up?

shadowsurge
  • 163
  • 1
  • 1
  • 6

2 Answers2

27

You can turn off that check in Tools/Options/Environment/Documents

Uncheck "Check for consistent line endings on load"

Line endings check

Szabolcs Dézsi
  • 8,743
  • 21
  • 29
  • 6
    This looks more like ignoring the problem, rather than solving it. :( what is causing this problem? Is it a bug in Unity or in VS? How comes that I'm programming on Windows with programs made for Windows and they still got to have mixed line endings types? – ocramot Sep 19 '17 at 08:32
  • It's difficult to answer that without knowing more about this particular case, but one possible cause can be if a file is edited by multiple people with different OSes, since the line endings are encoded by different character sequences on different OSes. – Szabolcs Dézsi Sep 19 '17 at 11:23
  • 3
    I'm sorry, I stumbled upon this question because I have a similar problem. In my case, I'm working all by myself on this project, on windows, but the same files are managed both by Unity and by Visual Studio. It seems like for some reason, they treat the files in a different way. – ocramot Sep 19 '17 at 19:46
1

If you don't want to cover up by changing the document setting, you can try and remediate by replacing the faulty line endings. See post 'how to fix inconsistent line endings for whole vs solution.

Pascal Desmet
  • 11
  • 1
  • 2