Scott,

Here it is.  Pretty straight forward.

using System;
using System.IO;

using NAnt.Core;
using NAnt.Core.Tasks;
using NAnt.Core.Attributes;

namespace SampleNantBuildLibrary
{
        
        
        [TaskName("SampleNantBuildLibrary.AddNumber")]  
        public class SampleNantBuildClassTask : Task
        {
                public SampleNantBuildClassTask()
                {
                } 

                private int intTotal = 0;
                
                private int intAddvalue;


                [TaskAttribute("AddValue")]
                public string AddValue 
                {
                        get     { return this.intAddvalue.ToString();  }
                        set { this.intAddvalue = Convert.ToInt32( value ); }
                }



                protected override void ExecuteTask()
                {

                        FileStream outFileStream = null;
                        StreamWriter writer = null;


                                this.intTotal += this.intAddvalue + 1;
                                outFileStream = File.Open( "C:\\Testfile.txt", 
FileMode.Create );
                                writer = new StreamWriter( outFileStream );

                                writer.WriteLine( this.intTotal.ToString() );
                                writer.Flush();
                                writer.Close();
                                outFileStream.Close();

                }

        }

}


I don't see anything wrong with it.  I really think that the Nant
v0.8.3 compile with the new log4net version8beta don't like each
other.  But I can be wrong.   Could other users here provide feedback
please?


mike

--- Scott Hernandez <[EMAIL PROTECTED]> wrote:
> Can you post the class def part of your custom tasks?
> 
> This sounds like there is a missing [TaskName] decl. for your task.
> Also, if
> you can provide your custom task, to me, or in as a link, I'm sure
> somebody
> can take a look. :)
> 
> ----- Original Message ----- 
> From: "Michael Dang" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, November 12, 2003 3:31 PM
> Subject: [Nant-users] Unknown Task or Datatype help with v0.8.3
> 
> 
> > Hi,
> >
> > I was trying to do a few things with Nant.
> >
> > Recompile the v0.8.3 Stable release with a new Log4net
> version8beta.
> >
> > Here are the steps I took to recompile nant:
> >
> > 1) Copied the version8beta of log4net.dll (v1.2.0.30714) into
> > C:\temp\nant-0.8.3.50105\bin
> >
> > 2) changed the following property in Nant.Build &
> > NAnt.SourceControl.build files
> >
> >   <property name="log4netdll" value="log4net.dll" />
> >
> > 3) changed the project.config property in the Nant.build file to
> > release.
> >
> > <property name="project.config" value="release" />
> >
> > 4) ran "bin\nant" from "C:\temp\nant-0.8.3.50105" to recompile
> Nant.
> > All successful builds & Tests.
> >
> > 5) Copied all the files that were generated in the Build folder
> to
> > "C:\temp\nant-0.8.3.50105\bin"
> >
> > 6) I recompiled my custom assembly that inherits Nant.Core Tasks
> with
> > the new Nant.Core.dll assembly built.
> >
> > This custom assembly has custom nant Tasks that worked before I
> > recompiled Nant.  Now I am getting an "invalid element <task
> name>
> > Unknown Task or datatype" error after the recompile.  Am I
> missing
> > something to make this work again?
> >
> >
> > Also, if I used a new Daily Nant build that was built with the
> same
> > version8beta of the log4net I am using. What files from the Nant
> > v0.8.3 that I would need to include/copy to use the NantContrib
> > tasks?
> >
> > Thanks in advance.
> 


=====
Michael Dang

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to