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
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- Crash with “Fatal Error! The file ‘MemoryStream’ is corrupted!” when adding a large number in Font Character Rects Size field
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)"