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
- Profiler search results are delayed when any search result is selected, and another frame is viewed
- [Linux] Cannot reorder GameObjects in the Hierarchy when the AI Assistant package is installed
- [iOS] Text Input field stops receiving changes when the "Cancel" button is used on the soft keyboard
- [WebGPU] URP RenderGraph RenderPass doesn't clear textures
- Query Builder items display raw code style names instead of human readable labels in search 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)"