- Home /
How to prevent the error "Unable to read the project file ... The attribute "xmlns" in element is unrecognized"?
How can I prevent the error "Unable to read the project file ... The attribute "xmlns" in element is unrecognized" when my Unity project reloads in Visual Studio 2010? I know how to temporarily fix this issue by editing the project's corresponding xml file and deleting out that offending attribute, but it's really annoying to have to keep doing this every time my project reloads. Here's a screenshot of the error:
![alt text][1]
Some details: I'm using Unity Pro 4.1.1f4 on a Windows 7 machine and Visual Studio 2010 Professional. I never had this problem until I switched my External Editor setting in Unity to MonoDevelop for debugging, and then switched back to Visual Studio. Here's the node I have to remove/edit:
<ProjectExtensions xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<MonoDevelop>
<Properties>
<Policies>
<TextStylePolicy EolMarker="Windows" inheritsSet="Mono" inheritsScope="text/plain" scope="text/x-csharp" />
<CSharpFormattingPolicy inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" />
</Policies>
</Properties>
</MonoDevelop>
</ProjectExtensions>
I've looked for posts about this error for a long time and I'm coming up empty. Thanks! [1]: /storage/temp/9598-visualstudioerrors.png
Answer by salat · Jul 30, 2013 at 07:57 AM
This is exactly the good and long term solution, thanks for pointing this post out! :)
Answer by Inhuman Games · Jul 24, 2013 at 11:39 AM
Did you change your EolMarker setting in MonoDevelop to be "Windows" instead of the default? I was getting the same error as you after I made this change. So I reverted the change and it seems to be working again. Revert your change from "Custom" to "Inherited"
In Mono, Project Settings->Assembly-CSharp Options->C# source code->Policy = Inherited Policy
Answer by SAday · Apr 30, 2014 at 04:02 PM
What is the solution to this? I've searched for 2 days, read the linked article and everything else I can find. Nothing solves it.
Using Unity 4.3.4f1 which packages MonoDevelop 4.0.1.
Answer by McAden · Sep 13, 2014 at 05:51 AM
Unity3D seems to be editing the csproj based upon whatever template it's already using rather than recreating it for Visual Studio. Once it goes to Monodevelop it doesn't want to go back.
Solution: Delete the sln and csproj files completely. Unity3D will completely regenerate them anyway and it will do it from scratch and correctly for Visual Studio but only if they are deleted completely. Once you do that and it does so correctly then they'll stay correct and you won't have to redo anything or delete them again.