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
- Blank, Light-Themed "Create Node" window becomes visible on the next project open
- UI Elements/Layout inconsistencies in the Particle System component
- The Game view and Scene view fail to render when launching the Editor with a maximized Render Graph Viewer window
- "List is empty" is poorly visible in the "Create Node" window
- [Android] GameObject with a custom shader becomes invisible when deployed with the Vulkan Graphics API
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)"