Search Issue Tracker
Won't Fix
Votes
2
Found in
5.2.2f1
Issue ID
745745
Regression
No
[Windows/VS2015] Editing scripts with Visual studio cause inconsistent line endings
Steps to reproduce:
1. Create new project
2. Create new script
3. Open script using Visual Studio
4. In, for example, Start() create new line and in new line add 'Debug.Log(" ");'
5. Save script
6. Return to Unity editor
7. Notice warning in console "There are inconsistent line endings in the 'Assets/NewBehaviourScript.cs' script. Some are Mac OS X (UNIX) and some are Windows. This might lead to incorrect line numbers in stacktraces and compiler errors. Many text editors can fix this using Convert Line Endings menu commands.
Expected behaviour: Script has only Windows line endings and no warnings are thrown
Workaround: Open script again. VS will show pop-up that there are inconsistent line endings. When asked to convert, accept.
Comments (3)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Selim-aga
Feb 09, 2020 10:04
Hello, I found fix go to Edit->Advanced->Set Newlines-> CRLF... Cheers
rstern
Jan 18, 2018 03:58
As of Visual Studio 2017 the above fix no longer works. The Advanced Save Options has been removed. The new solution is hidden away in Save As options and takes several more steps.
This is extremely annoying now and needs to be fixed on Unity's end. Unity should create the same line endings as the OS, should accept all line endings and not warn about them.
ThinkBotLabs
Oct 31, 2016 00:16
This is still an issue. Workaround is from Visual Studio: File->Advanced Save Options->Change Line Endings: Set this to "Windows (CR LF)"