How to prevent the error "Unable to read the project file ... The attribute "xmlns"?

Discussion in 'Unity Support' started by Picklefall1, Apr 2, 2013.

  1. Picklefall1

    Picklefall1

    New Member

    Joined:
    Oct 24, 2012
    Messages:
    5
    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:

    $visualstudioerrors.png

    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:

    Code (csharp):
    1.  
    2.     <ProjectExtensions xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    3.     <MonoDevelop>
    4.     <Properties>
    5.     <Policies>
    6.     <TextStylePolicy EolMarker="Windows" inheritsSet="Mono" inheritsScope="text/plain" scope="text/x-csharp" />
    7.     <CSharpFormattingPolicy inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" />
    8.     </Policies>
    9.     </Properties>
    10.     </MonoDevelop>
    11.     </ProjectExtensions>
    12.  
    I've looked for posts about this error for a long time and I'm coming up empty. Thanks!
  2. UnLogick

    UnLogick

    Unity Technologies

    Joined:
    Jun 11, 2011
    Messages:
    800
    Unity 4.1.1 was retracted because of a different problem with external DLLs when building within Visual Studio and Mono Develop. It may or may not be related to the problem you're experiencing.

    Please upgrade to 4.1.2 and see if the problem still exists. If the problem haven't been fixed by 4.1.2 please file a bug and list the bug number here and I'll take a look.
  3. Picklefall1

    Picklefall1

    New Member

    Joined:
    Oct 24, 2012
    Messages:
    5
    I upgraded to 4.1.2 just now, per your suggestion, and I'm still getting the error. I reported a bug: #535618. Thanks!
  4. UnLogick

    UnLogick

    Unity Technologies

    Joined:
    Jun 11, 2011
    Messages:
    800
    Solution for those who googled this thread.

    Problem was caused by read-only files, probably the visual studio solution, projects and user files. The only files that should be added to version control is those in the Assets and ProjectSettings folders. Under no circumstance should you add the solution files and Library folder to version control. As long as you use meta files and add those to version control along with your Assets and ProjectSettings everything else will be regenerated on demand.
    Last edited: Apr 4, 2013
  5. salat

    salat

    Member

    Joined:
    May 23, 2013
    Messages:
    3
  6. DatBear

    DatBear

    New Member

    Joined:
    Feb 19, 2014
    Messages:
    1
    I'm getting this error as well. Does anyone have a solution?
  7. Kieran Chandler

    Kieran Chandler

    Member

    Joined:
    Sep 29, 2011
    Messages:
    115
    To fix this error open the project file in a text editor and remove the project extension nodes.

    In my case i had to remove this:


    Code (csharp):
    1. <ProjectExtensions xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    2.         <MonoDevelop>
    3.           <Properties>
    4.             <Policies>
    5.               <TextStylePolicy inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/plain" />
    6.               <CSharpFormattingPolicy IndentSwitchBody="True" AnonymousMethodBraceStyle="NextLine" PropertyBraceStyle="NextLine" PropertyGetBraceStyle="NextLine" PropertySetBraceStyle="NextLine" EventBraceStyle="NextLine" EventAddBraceStyle="NextLine" EventRemoveBraceStyle="NextLine" StatementBraceStyle="NextLine" ArrayInitializerBraceStyle="NextLine" BeforeMethodDeclarationParentheses="False" BeforeMethodCallParentheses="False" BeforeConstructorDeclarationParentheses="False" BeforeDelegateDeclarationParentheses="False" NewParentheses="False" inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" />
    7.             </Policies>
    8.           </Properties>
    9.         </MonoDevelop>
    10.       </ProjectExtensions>