Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
1
Question by harikrishnan_annappilly · May 29, 2018 at 06:05 AM · unity 5errorvisual studiosettings

XmlException: a name did not start with a legal character 32 ( ) line 56 position 30

I am setting up Visual Studio for Unity but after installing the VS tools Unity i am getting a error when ever I create a script. Can anyone help me to solve this issue.

XmlException: a name did not start with a legal character 32 ( ) Line 56, position 30. Mono.Xml2.XmlTextReader.ReadName (System.String& prefix, System.String& localName) Mono.Xml2.XmlTextReader.ReadName () Mono.Xml2.XmlTextReader.ReadEntityReference (Boolean ignoreEntityReferences) Mono.Xml2.XmlTextReader.ReadReference (Boolean ignoreEntityReferences) Mono.Xml2.XmlTextReader.ReadText (Boolean notWhitespace) Mono.Xml2.XmlTextReader.ReadContent () Mono.Xml2.XmlTextReader.Read () System.Xml.XmlTextReader.Read () Mono.Xml.XmlFilterReader.Read () System.Xml.Linq.XElement.LoadCore (System.Xml.XmlReader r, LoadOptions options) System.Xml.Linq.XNode.ReadFrom (System.Xml.XmlReader r, LoadOptions options) System.Xml.Linq.XContainer.ReadContentFrom (System.Xml.XmlReader reader, LoadOptions options) System.Xml.Linq.XElement.LoadCore (System.Xml.XmlReader r, LoadOptions options) System.Xml.Linq.XNode.ReadFrom (System.Xml.XmlReader r, LoadOptions options) System.Xml.Linq.XContainer.ReadContentFrom (System.Xml.XmlReader reader, LoadOptions options) System.Xml.Linq.XElement.LoadCore (System.Xml.XmlReader r, LoadOptions options) System.Xml.Linq.XNode.ReadFrom (System.Xml.XmlReader r, LoadOptions options) System.Xml.Linq.XContainer.ReadContentFrom (System.Xml.XmlReader reader, LoadOptions options) System.Xml.Linq.XElement.LoadCore (System.Xml.XmlReader r, LoadOptions options) System.Xml.Linq.XNode.ReadFrom (System.Xml.XmlReader r, LoadOptions options) System.Xml.Linq.XContainer.ReadContentFrom (System.Xml.XmlReader reader, LoadOptions options) System.Xml.Linq.XDocument.ReadContent (System.Xml.XmlReader reader, LoadOptions options) System.Xml.Linq.XDocument.LoadCore (System.Xml.XmlReader reader, LoadOptions options) System.Xml.Linq.XDocument.Load (System.IO.TextReader reader, LoadOptions options) System.Xml.Linq.XDocument.Parse (System.String s, LoadOptions options) System.Xml.Linq.XDocument.Parse (System.String s) SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilePostprocessor.OnGeneratedCSProject (System.String path, System.String content) System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115) UnityEditor.AssetPostprocessingInternal.CallOnGeneratedCSProject (System.String path, System.String content) (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:75) UnityEditor.VisualStudioIntegration.SolutionSynchronizer.SyncProjectFileIfNotChanged (System.String path, System.String newContents) (at C:/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:310) UnityEditor.VisualStudioIntegration.SolutionSynchronizer.SyncProject (MonoIsland island, System.Collections.Generic.Dictionary`2 allAssetsProjectParts, UnityEditor.Scripting.Compilers.ResponseFileData responseFileData, System.Collections.Generic.List`1 allProjectIslands) (at C:/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:303) UnityEditor.VisualStudioIntegration.SolutionSynchronizer.GenerateAndWriteSolutionAndProjects (ScriptEditor scriptEditor) (at C:/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:234) UnityEditor.VisualStudioIntegration.SolutionSynchronizer.Sync () (at C:/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:206) UnityEditor.SyncVS.SyncIfFirstFileOpenSinceDomainLoad () (at C:/buildslave/unity/build/Editor/Mono/SyncProject.cs:199) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Comment
Add comment · Show 4
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 tezer86 · Jun 24, 2018 at 02:41 PM 0
Share

hey did you work this out in the end, I am getting the same error?

avatar image PanGrothaus · Jul 08, 2018 at 12:30 AM 0
Share

I'm having the same problem. Everytime I create a new script it's giving this error. I'm using Visual Studio for $$anonymous$$ac and Unity 2018. Has anyone found a solution to this problem?

avatar image Monochrome_Night · Jul 11, 2018 at 01:02 AM 0
Share

I'm having the same issue as well. And I get a missing .csproj message form Visual Studio. Driving me nuts.

avatar image PanGrothaus Monochrome_Night · Jul 11, 2018 at 05:49 AM 0
Share

Try this. Go into preferences in Unity under External tools and see if Editor Attaching is checked. If it is, uncheck it. Create a new script and then open that script and see if you still get those same errors.

Let me know if that helped.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Bunny83 · Jul 11, 2018 at 07:21 AM

Well, it's hard to tell anything specific from just getting thrown at a stacktrace. Though from the stacktrace we can see that the error comes from Unity's project file post processing when it tries to read back in a project file.


When inspecting the actual source code of the XmlTextReader it looks like you somehow have an ampersand (&) character somewhere (maybe in one of your filenames) that somehow did not get escaped properly. Ampersand characters denote an entity reference within an Xml document and they need to be escaped with &. Make sure all your script, project and solution file names do not contain any ampersand characters.


Actually I even avoid having any space characters in file names as well and restrict myself to ascii characters. I follow this rule for at least the last 20 years as you can run into countless of issues otherwise.


This may be a bug in the software that created the solution file first. It might be Unity. If you can't resolve your issue you should file a bugreport and make sure you include your project with the .csproj ans .sln files. We can't reproduce the exact workflow how the project files are generated. That's something the Unity devs have to investigate. Make sure when you file a bugreport to include your project as well as the full stacktrace as shown in the question here. You may also add a link to this question.

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 PanGrothaus · Jul 11, 2018 at 05:35 PM 0
Share

@Bunny83 O$$anonymous$$, so it was in my na$$anonymous$$g. I did have a (&) in one of my folder names. Changing that folder name is what solved the problem. I tried a few different things to solve the problem and I wasn't sure exactly which one it was. Now I know. Thanks

avatar image
1

Answer by sicklepickle · Jan 11, 2019 at 07:03 PM

You may have a malformed comment in one of your XMLs. ( same error during build process with an AndroidManifest.xml or partial AndroidManifest.xml btw )

e.g.

 <-- this is a malformed comment -->

vs < !-- this is how it's meant to look with the exclamation mark -->

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

197 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 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 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 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 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Visual Studio Code doesn't work for with unity 2 Answers

Legacy Animations and Unity 5 - What's The Deal? 1 Answer

Lightmapping Shadows Jagged 1 Answer

Unity 5 fatal error 3 Answers

Unity 5 crash on startup 1 Answer


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