Bugs item #1262050, was opened at 2005-08-17 08:42
Message generated for change (Comment added) made by garyfx
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1262050&group_id=31650

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Tasks
Group: 0.85
>Status: Closed
>Resolution: Duplicate
Priority: 5
Submitted By: Boudino (boudino)
Assigned to: Nobody/Anonymous (nobody)
Summary: Solution tasks does not understood VS 2005 format

Initial Comment:
Solution task is not ready for VS 2005 formats. 
Both .sln and .csproj fileshas changed.

NAnt fails with:
Error loading GUID of project 'myproject.csproj'.             
Couldn't locate ProjectGuid in project 'myproject.csproj'.
            


----------------------------------------------------------------------

>Comment By: Gary Feldman (garyfx)
Date: 2006-04-17 19:17

Message:
Logged In: YES 
user_id=847172

I don't know whether the patch here helps or not, but in any
event, I'm closing this as a duplicate of feature request
1209122 .  

----------------------------------------------------------------------

Comment By: Michael Edenfield (kutulu)
Date: 2006-01-03 17:29

Message:
Logged In: YES 
user_id=67958

Wow that line wrapping was horrible.  See patch file:

http://www.kutulu.org/1262050.diff

----------------------------------------------------------------------

Comment By: Michael Edenfield (kutulu)
Date: 2006-01-03 17:27

Message:
Logged In: YES 
user_id=67958

The following patch file should correct this (simply needs
to look in a different XML path for the GUID).

--- ProjectSettings.cs.old      2005-03-03 05:49:54.000000000 -0500
+++ ProjectSettings.cs  2006-01-03 17:12:46.677016500 -0500
@@ -312,15 +312,29 @@
         /// The project GUID from specified
<c>&lt;VisualStudioProject&gt;</c> node.
         /// </returns>
         public static string GetProjectGuid(string
projectFile, XmlElement elemRoot) {
-            XmlAttribute projectGuid = (XmlAttribute)
elemRoot.FirstChild.
-                Attributes["ProjectGuid"];
-            if (projectGuid == null) {
-                throw new
BuildException(string.Format(CultureInfo.InvariantCulture,
-                    "Project file '{0}' is not valid.
There's no \"ProjectGuid\""
-                    + " attribute on the <{1} ... />
node.", projectFile, 
-                    elemRoot.FirstChild.Name),
Location.UnknownLocation);
+            string projectGuid = String.Empty;
+            
+            // Try the VS.NET/VS.NET 2003 proejct file
format first.
+            // Example XPath =
/VisualStudioProject/CSHARP/@ProjectGuid
+            XmlNode projectGuidNode =
elemRoot.FirstChild.Attributes["ProjectGuid"];
+            if (projectGuidNode == null) {
+               // Try the new VS.NET 2005 format.
+               // Example XPath =
/Project/PropertyGroup/ProjectGuid
+               projectGuidNode =
elemRoot.SelectSingleNode("//PropertyGroup/ProjectGuid");
+               if (projectGuidNode == null) {
+                   // Not any recognizeable format.
+                    throw new
BuildException(string.Format(CultureInfo.InvariantCulture,
+                        "Project file '{0}' is not valid.
There's no \"ProjectGuid\""
+                        + " attribute/element on the <{1}
... /> node.",
+                        projectFile,
elemRoot.FirstChild.Name), Location.UnknownLocation);
+                }
+                projectGuid =
projectGuidNode.InnerText.ToUpper(CultureInfo.InvariantCulture);
             }
-            return
projectGuid.Value.ToUpper(CultureInfo.InvariantCulture);
+            else {
+                projectGuid =
projectGuidNode.Value.ToUpper(CultureInfo.InvariantCulture);
+            }
+            
+            return projectGuid;
         }
 
         #endregion Public Static Methods


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1262050&group_id=31650


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to