Hi,
What is wrong with the following script task. Have just started using NAnt and
this is my first effort writting a script for it.
<script language="C#">
<code>
<references>
<includes name="System.XML.dll" asis="true" />
</references>
<![CDATA[
public static void ScriptMain(Project project) {
System.XML.XmlDocument doc = new System.XML.XmlDocument();
doc.Load("${build.config}");
System.XML.XmlNodeList apps = doc.SelectNodes(
"//build-config/applications/application" );
foreach ( System.XML.XmlElement app in apps )
{
Project.Properties["app.build.file"] = app.SelectSingleNode(
"build-file" ).Value;
Project.Execute( "buildApplication" );
}
}
]]>
</code>
</script>
I get the error:
Compilation failed:
c:\Documents and Settings\paul.scobell\Local Settings\Temp\eoozkxgv.0.cs(13,20)
: error CS0234: The type or namespace name 'XML' does not exist in the class or
namespace 'System' (are you missing an assembly reference?)
c:\Documents and Settings\paul.scobell\Local Settings\Temp\eoozkxgv.0.cs(14,13)
: error CS0246: The type or namespace name 'doc' could not be found (are you mis
sing a using directive or an assembly reference?)
c:\Documents and Settings\paul.scobell\Local Settings\Temp\eoozkxgv.0.cs(15,20)
: error CS0234: The type or namespace name 'XML' does not exist in the class or
namespace 'System' (are you missing an assembly reference?)
c:\Documents and Settings\paul.scobell\Local Settings\Temp\eoozkxgv.0.cs(16,52)
: error CS0103: The name 'apps' does not exist in the class or namespace 'nant81
f1ccc9399c43faa59ec98bb1f4e82d'
Thanks for any help!
Paul Scobell
This message is for the designated recipient only and may contain confidential,
proprietary, or otherwise private information. If you have received it in
error, please notify the sender by return email immediately and delete the
original. Any review, re-transmission, disclosure, dissemination or other use
of, or taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited and may result in
legal proceedings against you.