Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2013 error creating Web API project: The element <#text> beneath element <Project> is unrecognized

I have a problem with my Visual Studio installation.

To reproduce it I have created a new blank solution and then:

  • Add new project..
  • ASP.NET Web Application
  • Web API
  • Create Project

Visual Studio fails to create it an I get this message:

The element <#text> beneath element <Project> is unrecognized.

Any ideas how to fix that?

like image 259
Andrew Barnes Avatar asked Apr 22 '15 10:04

Andrew Barnes


2 Answers

You will get such an error if csproj contains invalid XML.
I encountered this error when I accidentally removed <!-- inside csproj file and leave -->:

<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
like image 74
Shrike Avatar answered Sep 20 '22 00:09

Shrike


This doesn't address the OP's precise problem, but I stumbled across this question when I had a legitimate XML break. Sometimes, these are just really hard to spot errors, even with good IDEs.

I had to go through a diff of a ~~800 line XML file until I spotted a closing bracket with an extra >.

I wasn't able to spot it in VS2015, VS Code, Notepad++, and even WC3's automated checks -- it wasn't until I did a diff between the before and after when I noticed it. Sometimes the linters just don't catch stuff, or the suspiciously flagged area is so tiny, you miss it. enter image description here

like image 45
kayleeFrye_onDeck Avatar answered Sep 21 '22 00:09

kayleeFrye_onDeck