I have a newly created task that is not being seen by NAnt. When I debug the
reflection into task dlls. It seems that IsSubclassOf is not working
correctly. I had a similar problem the other day when I was compiling my
task in a seperate Dll. Weird thing is that currently all my other tasks are
passing this evaluation.

// --- I modified the code for easier debugging ---
Type taskClass = typeof(Task);
foreach(Type type in assembly.GetTypes()) {
        if (type.IsSubclassOf(taskClass)) {
                if(type.IsAbstract) continue;

                //... Never gets here for new task 

        }
}

Debugger values:
//type being considered
+       type    {"NAnt.Contrib.Tasks.StarTeam.StarTeamAutoLabel"}
System.Type
//evidence that this class IS a subclass of Task
+       type.BaseType.BaseType.BaseType {"SourceForge.NAnt.Task"}
System.Type     
//actual evaluation
type.IsSubclassOf(taskClass)    false   bool
//for show
type.IsAbstract false   bool

Do not know what I am doing wrong in my class. Or why Reflection is messing
up. Any ideas?

Kevin Miller


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to