* Project.cs (DoLoad): If a VS2003 project is detected, then throw
authorAnkit Jain <radical@corewars.org>
Thu, 24 Sep 2009 19:04:52 +0000 (19:04 -0000)
committerAnkit Jain <radical@corewars.org>
Thu, 24 Sep 2009 19:04:52 +0000 (19:04 -0000)
InvalidProjectFileException with useful error.

svn path=/trunk/mcs/; revision=142596

mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs

index 5e2c4847326b35c6b38ff257b6e741475b40e549..338febfbbc50af23b394d2714ee18f17608c967b 100644 (file)
@@ -1,3 +1,8 @@
+2009-09-25  Ankit Jain  <jankit@novell.com>
+
+       * Project.cs (DoLoad): If a VS2003 project is detected, then throw
+       InvalidProjectFileException with useful error.
+
 2009-09-24  Ankit Jain  <jankit@novell.com>
 
        * Project.cs (Load): Emit the .sln.proj file only if env var
index 225d3d764102a26d70e16d27fc64f7510fc932f5..d6a43d1eaa485ac93c8885ed20f02c21cfe53ab2 100644 (file)
@@ -716,6 +716,12 @@ namespace Microsoft.Build.BuildEngine {
                                XmlReader xmlReader = XmlReader.Create (textReader, settings);
                                xmlDocument.Load (xmlReader);
 
+                               if (xmlDocument.DocumentElement.Name == "VisualStudioProject")
+                                       throw new InvalidProjectFileException (String.Format (
+                                                       "Project file '{0}' is a VS2003 project, which is not " +
+                                                       "supported by xbuild. You need to convert it to msbuild " +
+                                                       "format to build with xbuild.", fullFileName));
+
                                if (xmlDocument.DocumentElement.Name != "Project") {
                                        throw new InvalidProjectFileException (String.Format (
                                                "The element <{0}> is unrecognized, or not supported in this context.", xmlDocument.DocumentElement.Name));