Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
5
Question by mattyman174 · Feb 25, 2014 at 08:04 AM · c#visual studiolineinconsistent

Visual Studio 2010 causing: Inconsistent Line Endings...

There are inconsistent line endings in the 'Assets/Plugins/AIManager/Pathfinding Engine/AI/AIAgent.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.

Ive had this come up since i Formatted my PC sometime ago and i still cant figure out how to remove this annoying Warning i get not only in Unity but also in VS.

Whenever i make changes to a cs file i get this warning in Unity and a popup window in VS that tells me the Line Endings are inconsistent or some such and do i wish to convert them?

I havent delved to deep into the issue since its more of an inconvenience than a hindrance and thought someone else here may have come across this as well or know where to disable this feature or make it automatic in VS.

Thanks guys.

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Nick4 · Feb 25, 2014 at 08:35 AM 0
Share

I'm frequently getting that as well. It really annoys me to go back to visual studio and change the line endings to Windows(CR LF) everytime it pops up. You can do that by clicking file menu and opening "advanced save options". If there's a way to set it as default, I'd like to hear it as well.

avatar image Snownebula · Aug 12, 2014 at 11:09 AM 0
Share

What is the answer for this? I am useing $$anonymous$$onoDevelop.

avatar image Bunny83 · Aug 12, 2014 at 11:31 AM 0
Share

@Snownebula: Don't post such questions as answer. If you get that warning, that means your file(s) have mixed line endings. $$anonymous$$ac / Unix usually uses just a "line feed character" 0x0A and windows usually uses "carriage return" 0x0D and a "line feed" 0x0A together to mark the end of a line.

In some editors you can choose in the settings which line endings the editor should use when you make a new line. However those line endings which are already in the file aren't changed.

In $$anonymous$$onoDevelop you can set the desired line ending in the options.
Go to Tools -> Options -> Source Code -> Code Formatting -> TextFile

There you can choose which line endings $$anonymous$$onoDevelop will use from now on. Native will use the one the operating system is using by default.

What $$anonymous$$TheDev answer means:
When you create a new script in Unity, Unity uses the templates found in the folder he has mentioned. You should make sure that those templates are saved with the same line endings you're editor is using. Otherwise you get mixed line endings again.

Unfortunately $$anonymous$$onoDevelop doesn't have a function to "normalize" the line endings of a file. There are other editors which have such a function.

3 Replies

· Add your reply
  • Sort: 
avatar image
17
Best Answer

Answer by RudyTheDev · Feb 25, 2014 at 10:38 AM

Go to "\\Unity\\Editor\\Data\\Resources\\ScriptTemplates\\C# Script-NewBehaviourScript.cs.txt" and change it to your desired line endings.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mattyman174 · Feb 25, 2014 at 11:17 AM 0
Share

So far so good :)

Cheers

avatar image AironeneroTechnologies · Sep 20, 2014 at 06:26 PM 0
Share

Worked perceftly, thanks!

avatar image PaxForce · Nov 19, 2014 at 08:28 AM 1
Share

I'm in that txt file right now, but I can't see how to "change it". Could you elaborate a bit?

avatar image RudyTheDev · Nov 27, 2014 at 08:49 PM 0
Share

You can usually select all, cut, then paste the entire text and that would do it. Your OS would (typically) change the newlines to use its own newline syntax. Then the pasted text will have those once you resave.

Failing that, you need a text editor that can show you exact line endings.

avatar image Nubz · Jan 24, 2015 at 11:24 PM 0
Share

Bad answer since it will just do it again when you edit the file.

avatar image
8

Answer by Mortalanimal · Jun 03, 2016 at 06:03 PM

In Visual Studio 2015:

Tool → Options → Environments → Documents → Check for consistent line ending on load.

It will then propose you to convert line ending on opening. Then just open the files and save them.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image spark1998 · May 30, 2017 at 04:52 AM 0
Share

Thank you so much you really solved my problem the visual studio automatically solve such problem when we enable this. In visual studio 2017 it is automatically switched on.

avatar image
0

Answer by ahmedaniss · Aug 01, 2020 at 12:27 PM

problem fixed here : https://youtu.be/GP9hUFEZp6Y

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

27 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Character Wont Stop Moving 1 Answer

Is there a plugin for Visual Studio to find references to C# methods from Unity Events in scenes 0 Answers

Is there any way to run a class script from visual studio? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges