Re: Unable to use latest nant 0.91
Ryan Boggs <[email protected]> Fri, 9 Mar 2012 20:26:23 -0800
| Newsgroups | gmane.comp.windows.dotnet.nant.user |
|---|---|
| Message-ID | <CAJg1EnDmX9mFkkKk3Jf7f7DZA9oKdEprtDkNXrdt2RoYHwD=pg@mail.gmail.com> |
Hi, I don't know what exactly is in your build file but are you including a reference to System.Xml.dll in your build? Thanks, Ryan On Fri, Mar 9, 2012 at 8:03 PM, Sunil Singh <[email protected]> wrote: > Hi All, > I recemtly tried to use nant 0.91 to do build on windows 2003 server > but got following error. =A0I tried on multiple machine but same issue. > I have ,net 4.0 installed .. > > Am i missing anything.?? > > NAnt 0.91 (Build 0.91.4312.0; release; 10/22/2011) > > Copyright (C) 2001-2011 Gerry Shaw > > http://nant.sourceforge.net > > > > Buildfile: file:///G:/TFS/BetaEngine/Deployment/Scripts/build.xml > > Target framework: Microsoft .NET Framework 4.0 > > Target(s) specified: createDrop > > > > > > OnFailure: > > > > =A0 =A0 [echo] Build failed at 03/08/2012 19:50:56 > > > > BUILD FAILED > > > > Compilation failed: > > c:\Documents and Settings\sysibdpribuilduserd\Local > Settings\Temp\1\fohsvsqg.0.cs(17,14) : error CS0234: The type or > namespace name 'Xml' does not > > //-----------------------------------------------------------------------= ------- > > // <auto-generated> > > // =A0 =A0 This code was generated by a tool. > > // =A0 =A0 Runtime Version:4.0.30319.488 > > // > > // =A0 =A0 Changes to this file may cause incorrect behavior and will be = lost if > > // =A0 =A0 the code is regenerated. > > // </auto-generated> > > //-----------------------------------------------------------------------= ------- > > > > using NAnt.Core; > > using NAnt.Core.Attributes; > > using System; > > using System.Collections; > > using System.IO; > > using System.Text; > > using System.Xml; > > > > > > > > [FunctionSet("DeployUtils", "DeployUtils")] > > public class nantddaf318abf45436db87f93cbfb2ae9ea : NAnt.Core.FunctionSet= Base { > > > > > > =A0[TaskName("fixXpath")] > > =A0public class FixXPathTask : Task { > > > > =A0 =A0private string _srcFile; > > =A0 =A0private string _xpath; > > =A0 =A0private string _attribute; > > =A0 =A0private string _value; > > =A0 =A0private string _ns; > > > > =A0 =A0private string _execStatus; > > > > =A0 =A0[TaskAttribute("file", Required=3Dtrue)] > > =A0 =A0public string SrcFile { > > =A0 =A0 get { return _srcFile; } > > =A0 =A0 set { _srcFile =3D value; } > > =A0 =A0} > > > > =A0 =A0[TaskAttribute("xpath", Required=3Dtrue)] > > =A0 =A0public string XPath { > > =A0 =A0 get { return _xpath; } > > =A0 =A0 set { _xpath =3D value; } > > =A0 =A0} > > > > =A0 =A0[TaskAttribute("attribute", Required=3Dtrue)] > > =A0 =A0public string Attribute { > > =A0 =A0 get { return _attribute; } > > =A0 =A0 set { _attribute =3D value; } > > =A0 =A0} > > > > =A0 =A0[TaskAttribute("value", Required=3Dtrue)] > > =A0 =A0public string Value { > > =A0 =A0 get { return _value; } > > =A0 =A0 set { _value =3D value; } > > =A0 =A0} > > > > =A0 =A0[TaskAttribute("namespace", Required=3Dfalse)] > > =A0 =A0public string Namespace { > > =A0 =A0 get { return _ns; } > > =A0 =A0 set { _ns =3D value; } > > =A0 =A0} > > > > > > =A0 =A0protected override void ExecuteTask() { > > > > =A0 Console.WriteLine("Fixing " + SrcFile + " "+XPath+ " " + Attribute); > > > > =A0 XmlDocument doc =3D new XmlDocument(); > > =A0 =A0 =A0 =A0 =A0 =A0doc.Load(SrcFile); > > > > =A0 =A0 =A0 =A0 =A0 =A0XmlNamespaceManager nsmgr =3D new XmlNamespaceMana= ger(doc.NameTable); > > =A0 if (Namespace !=3D null) > > =A0 { > > =A0 =A0nsmgr.AddNamespace(String.Empty, Namespace); > > =A0 } > > =A0 =A0 =A0 =A0 =A0 =A0XmlNode node =3D doc.SelectSingleNode(XPath ,nsmgr= ); > > =A0 =A0 =A0 =A0 =A0 =A0Console.WriteLine(node =3D=3D null ? "Node Not Fou= nd" : "Node Found"); > > =A0 =A0 =A0 =A0 node.Attributes[Attribute].Value =3D Value; > > =A0 =A0 =A0 =A0 =A0 =A0XmlWriterSettings settings =3D new XmlWriterSettin= gs(); > > =A0 =A0 =A0 =A0 =A0 =A0settings.Indent =3D true; > > =A0 =A0 =A0 =A0 =A0 =A0XmlWriter xw =3D XmlWriter.Create(SrcFile, setting= s); > > =A0 =A0 =A0 =A0 =A0 =A0doc.WriteContentTo(xw); > > =A0 =A0 =A0 =A0 =A0 =A0xw.Close(); > > =A0 =A0} > > =A0} > > > > =A0[TaskName("fixAllXpath")] > > =A0public class FixAllXPathTask : FixXPathTask { > > > > =A0 =A0private string _srcFile; > > =A0 =A0private string _xpath; > > =A0 =A0private string _attribute; > > =A0 =A0private string _value; > > =A0 =A0private string _ns; > > > > =A0 =A0private string _execStatus; > > > > =A0 =A0[TaskAttribute("file", Required=3Dtrue)] > > =A0 =A0public string SrcFile { > > =A0 =A0 get { return _srcFile; } > > =A0 =A0 set { _srcFile =3D value; } > > =A0 =A0} > > > > =A0 =A0[TaskAttribute("xpath", Required=3Dtrue)] > > =A0 =A0public string XPath { > > =A0 =A0 get { return _xpath; } > > =A0 =A0 set { _xpath =3D value; } > > =A0 =A0} > > > > =A0 =A0[TaskAttribute("attribute", Required=3Dtrue)] > > =A0 =A0public string Attribute { > > =A0 =A0 get { return _attribute; } > > =A0 =A0 set { _attribute =3D value; } > > =A0 =A0} > > > > =A0 =A0[TaskAttribute("value", Required=3Dtrue)] > > =A0 =A0public string Value { > > =A0 =A0 get { return _value; } > > =A0 =A0 set { _value =3D value; } > > =A0 =A0} > > > > =A0 =A0[TaskAttribute("namespace", Required=3Dfalse)] > > =A0 =A0public string Namespace { > > =A0 =A0 get { return _ns; } > > =A0 =A0 set { _ns =3D value; } > > =A0 =A0} > > > > > > =A0 =A0protected override void ExecuteTask() > > =A0 =A0{ > > > > =A0 =A0 Console.WriteLine("Fixing " + SrcFile + " "+XPath+ " " + Attribut= e); > > =A0 =A0 XmlDocument doc =3D new XmlDocument(); > > =A0 =A0 doc.Load(SrcFile); > > =A0 =A0 =A0 =A0 =A0 =A0 XmlNamespaceManager nsmgr =3D new XmlNamespaceMan= ager(doc.NameTable); > > =A0 =A0 if (Namespace !=3D null) > > =A0 =A0 { > > =A0 =A0 =A0nsmgr.AddNamespace("def", Namespace); > > =A0 =A0 } > > =A0 =A0 =A0 =A0XmlNodeList nodeList =3D doc.SelectNodes(XPath ,nsmgr); > > =A0Console.WriteLine("Found Nodes "+nodeList.Count); > > =A0 =A0 =A0 =A0foreach(XmlNode node in nodeList) > > =A0 =A0 =A0 =A0{ > > =A0 =A0 =A0 =A0 =A0node.Attributes[Attribute].Value =3D Value; > > =A0 =A0 =A0 =A0} > > > > > > =A0 =A0 =A0 =A0XmlWriterSettings settings =3D new XmlWriterSettings(); > > =A0 =A0 =A0 =A0settings.Indent =3D true; > > =A0 =A0 =A0 =A0XmlWriter xw =3D XmlWriter.Create(SrcFile, settings); > > =A0 =A0 =A0 =A0doc.WriteContentTo(xw); > > =A0 =A0 =A0 =A0xw.Close(); > > =A0 =A0} > > =A0} > > > > > > =A0 =A0public nantddaf318abf45436db87f93cbfb2ae9ea(NAnt.Core.Project > project, NAnt.Core.PropertyDictionary propDict) : > > =A0 =A0 =A0 =A0 =A0 =A0base(project, propDict) { > > =A0 =A0} > > } > > > > > > Total time: 0.4 seconds. > > -------------------------------------------------------------------------= ----- > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > NAnt-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/nant-users ---------------------------------------------------------------------------= --- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing = also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/