How to know if a VS Project belongs to a WEB Application or Windows Application
<p>I´m using C# Microsoft.Build.Evaluation.Project class to retrieve specific information from a VS project file like the TargetFramework, AssemblyName...etc. But I'm unable to find the way or the property name to identify if the project is a Web Project. For a VS Project in framework 1.1 I'm using Xml parsing like this.</p>

<pre><code>string path = "C:\\Test.csproj";
XElement root = XElement.Load(path);
var type = from el in root.Elements("CSHARP")
           select el.Attribute("ProjectType");
if (type.Count() &gt; 0)
{
  //  Local or Web
  return((XAttribute)type.First()).Value);
}
</code></pre>

<p>I'll appreciate if someone could give me the name of the property or another suggestion to solve this problem.</p>

<p>Thanks in advance.</p>

<p>My full method code</p>

<pre><code>public bool IsWeb(string path)
    {
        bool isWeb = false;
        try
        {

            Project project = new Project(path);

            // I dont know the name of the propety to identify if its a web project

            //string type = project.GetPropertyValue();
            //if (type.Equals("Web"))
            //{
            //    isWeb = true;
            //}

        }
        catch (InvalidProjectFileException)
        {
            //It's fw 1.1
            XElement root = XElement.Load(path);
            var type = from el in root.Elements("CSHARP")
                       select el.Attribute("ProjectType");

            if (type.Count() &gt; 0)
            {
                if ((((XAttribute)type.First()).Value).Equals("Web"))
                {
                    isWeb = true;
                }
            }

        }
        return isWeb;
    }
</code></pre>
