The element <#text> beneath element is unrecognized in Azure

前端 未结 6 1860
盖世英雄少女心
盖世英雄少女心 2021-01-11 17:27

Have a big problem here. I can\'t open any type of project in Visual Studio. Even when I creating a new one I get the error:

the element <#text> be

相关标签:
6条回答
  • 2021-01-11 17:43

    I faced this problem too. The error text was:

    The element <#text> beneath element <Target> is unrecognized.
    c:\Program Files (x86)\MSBuild\12.0\Bin\Microsoft.CSharp.CurrentVersion.targets
    

    The solution for me was to check the indicated file against a working one from one of my coleagues. Even an XML parser or even a browser would pop-up an error when faced to this sort of error. A element under <Target> was corrupt. Instead of <Csc ... /> I had exactly 07sc ... />. I fixed formatting and It worked. Mind you that the file indicated in the error text (Microsoft.CSharp.CurrentVersion.targets) was the guilty one. Hope this helps.

    0 讨论(0)
  • 2021-01-11 17:56

    I had this problem due to git merge conflicts inserting invisible characters into the xml file. To fix this:

    1. open sln file in a text editor and copy the contents into an online xml validator (https://www.xmlvalidation.com/)

    2. find location of invisible characters and either delete them or retype the line

    0 讨论(0)
  • 2021-01-11 18:06

    There will be a Typo in the .csProject. You can copy and paste the csProj XML into https://freeformatter.com/xml-formatter.html and it will show what line is causing the problem!

    0 讨论(0)
  • 2021-01-11 18:07

    This also happens if a Property, that should be under a <PropertyGroup> node is a child of a <Target> node

    wrong (produces the error):

    <Project ToolsVersion="15.0" DefaultTargets="CalculateVariables" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <Target Name="CalculateVariables">
        <IsWrong>true</IsWrong>
      </Target>
    </Project>
    

    right (works):

    <Project ToolsVersion="15.0" DefaultTargets="CalculateVariables" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <Target Name="CalculateVariables">
        <PropertyGroup>
          <IsWrong>true</IsWrong>
        <PropertyGroup>
      </Target>
    </Project>
    
    0 讨论(0)
  • 2021-01-11 18:08

    This also happens with generic XML errors. In my case it was >> somewhere in the project file. Was a copy-paste error during conflict resolution that introduced it. Sadly, the output does not include the line that has the error, so try searching for << and >> in the file, to see if that is an issue somewhere.

    0 讨论(0)
  • 2021-01-11 18:10

    This sure is a installation error and i would suggest don't try to fix because there may be more such errors. I have seen a few of such errors during my work with partners and mostly these errors are caused by botched installation due to real-time, virus scanner or some unknown issues in the machine.

    Here is what I could suggest:

    1. Uninstall Azure SDK completely, (check program list for any Azure related entry and uninstall)
    2. Restart your machine to clean from any residual setting or script running
    3. Download the SDK (if Web Deploy gave you error, try downloading full SDK here)
    4. Disable Virus scanner for a while or any real time file system or script monitoring tool (disconnect the machine from internet if you have concern)
    5. Install the SDK components.

    It worked in past so I hope it will work with you as well.

    0 讨论(0)
提交回复
热议问题