[nant-dev] RE: [Nant-users] Adding Tasks 0.7.9 vs 0.8

2003-02-12 Thread Brian Deacon
That will -definitely- keep it from working.  NAnt uses reflection in
combination with the TaskAttribute to match your attributes up with your
properties and a privately scoped property not only won't show up in
reflection, but NAnt wouldn't be able to assign to it even if it did.

Hmmm... Is there a flag to AttributeUsage that can specify public
properties only?  'twould seem nice if the compiler could have caught
that and failed the compile.

Brian
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Simon
Steele
Sent: Tuesday, February 11, 2003 7:14 AM
To: 'Gill, Bobby'; [EMAIL PROTECTED]
Subject: RE: [Nant-users] Adding Tasks 0.7.9 vs 0.8

Hi Bobby,

I wonder if you should have:

public string slnFileName
^^ Public access.

I'm not sure - without looking at your source, I couldn't be sure. All
of my
attributes are marked as public, and I've never had this problem.

Simon.

 -Original Message-
 From: Gill, Bobby [mailto:[EMAIL PROTECTED]] 
 Sent: 11 February 2003 14:59
 To: Simon Steele; [EMAIL PROTECTED]
 Subject: RE: [Nant-users] Adding Tasks 0.7.9 vs 0.8
 
 Another problem that I am having is with setting the values 
 of the TaskAttributes. For instance if I have:
 
 [TaskAttribute(solution,Required = true)]
   private string slnFileName 
   {
   get { return  slnFileName_m; } set {
 slnFileName_m=value;}
   }
 
 Whenever I try to reference the slnFileName_m variable, I 
 receive Null pointer errors. My .build file does have the 
 solution attribute along with a value within, but for some 
 reason, it doesn't seem to be transferring over to the 
 variable within the solution property? Any ideas as to what I 
 am missing?? Thanks
 
 Bobby Gill
 [EMAIL PROTECTED]

__
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service.


---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users



---
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



[nant-dev] RE: [Nant-users] Adding Tasks 0.7.9 vs 0.8

2003-02-12 Thread Bill Conroy
[Hello...new to the list]

 NAnt uses reflection in combination with the TaskAttribute 
 to match your attributes up with your properties and a privately 
 scoped property not only won't show up in reflection, 
 but NAnt wouldn't be able to assign to it even if it did.

You can view and set private members of a type. I have an example
below[1] that shows setting a private field on a type as well as a
private property.

The reason this doesn't work with Nant is because the Nant code
specifically checks only Public properties. Line 130 of Element.cs:

  PropertyInfo[] propertyInfoArray =
currentType.GetProperties(BindingFlags.Public|BindingFlags.Instance);

could be:

  PropertyInfo[] propertyInfoArray =
currentType.GetProperties(BindingFlags.NonPublic|BindingFlags.Instance);
Or:
  PropertyInfo[] propertyInfoArray =
currentType.GetProperties(BindingFlags.NonPublic|BindingFlags.Public|Bin
dingFlags.Instance);

HTH
-bc

[1]
code
namespace ReflectTest {
  using System;
  using System.Reflection;

  class Class1 {
static void Main(string[] args) {
  Class2 c2 = new Class2();
  Type t = typeof(Class2); // or c2.GetType()
  PropertyInfo[] propertyInfoArray =
t.GetProperties(BindingFlags.NonPublic|BindingFlags.Instance);
  foreach (PropertyInfo pi in propertyInfoArray ) {
System.Diagnostics.Debug.WriteLine(pi.Name);
pi.SetValue(c2, TestingProp, null);
  }
  // comments states I could do this, but code doesn't
  FieldInfo[] fis =
t.GetFields(BindingFlags.NonPublic|BindingFlags.Instance);
  foreach (FieldInfo fi in fis ) {
System.Diagnostics.Debug.WriteLine(fi.Name);
fi.SetValue(c2, TestingField);
System.Diagnostics.Debug.WriteLine(fi.GetValue(c2));
  }
}
  }

  class Class2 {
private string _prop;

private string prop {
  get {
return String.Empty;
  }

  set {
// for show
System.Diagnostics.Debug.WriteLine(value);
  }
}
  }
}
/code

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Brian
Deacon
Sent: Wednesday, February 12, 2003 9:39 PM
To: [EMAIL PROTECTED]; 'NAnt Developers (E-mail)'
Subject: RE: [Nant-users] Adding Tasks 0.7.9 vs 0.8


That will -definitely- keep it from working.  NAnt uses reflection in
combination with the TaskAttribute to match your attributes up with your
properties and a privately scoped property not only won't show up in
reflection, but NAnt wouldn't be able to assign to it even if it did.

Hmmm... Is there a flag to AttributeUsage that can specify public
properties only?  'twould seem nice if the compiler could have caught
that and failed the compile.

Brian
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Simon
Steele
Sent: Tuesday, February 11, 2003 7:14 AM
To: 'Gill, Bobby'; [EMAIL PROTECTED]
Subject: RE: [Nant-users] Adding Tasks 0.7.9 vs 0.8

Hi Bobby,

I wonder if you should have:

public string slnFileName
^^ Public access.

I'm not sure - without looking at your source, I couldn't be sure. All
of my attributes are marked as public, and I've never had this problem.

Simon.

 -Original Message-
 From: Gill, Bobby [mailto:[EMAIL PROTECTED]]
 Sent: 11 February 2003 14:59
 To: Simon Steele; [EMAIL PROTECTED]
 Subject: RE: [Nant-users] Adding Tasks 0.7.9 vs 0.8
 
 Another problem that I am having is with setting the values
 of the TaskAttributes. For instance if I have:
 
 [TaskAttribute(solution,Required = true)]
   private string slnFileName 
   {
   get { return  slnFileName_m; } set {
 slnFileName_m=value;}
   }
 
 Whenever I try to reference the slnFileName_m variable, I
 receive Null pointer errors. My .build file does have the 
 solution attribute along with a value within, but for some 
 reason, it doesn't seem to be transferring over to the 
 variable within the solution property? Any ideas as to what I 
 am missing?? Thanks
 
 Bobby Gill
 [EMAIL PROTECTED]

__
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service.


---
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
___
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users



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



---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.

[nant-dev] bug

2003-02-12 Thread Anthony Koukoullis



Not sure what I did, but I typed the following 
command:

nant -verbose -buildfile:csdpublish.build 
buildpublisher

and received the following error:

INTERNAL ERRORSystem.UriFormatException: 
Invalid URI: The format of the URI could not be determined. at 
System.Uri.Parse() at System.Uri..ctor(String uriString, Boolean 
dontEscape) at System.Uri..ctor(String 
uriString) at SourceForge.NAnt.Project..ctor(String 
source) at SourceForge.NAnt.NAnt.Main(String[] 
args)

Please send bug report to 
[EMAIL PROTECTED]


My build file follows:

?xml version="1.0"?project 
name="CSDPublish" default="buildall" basedir="."property 
name="basename" value="CSD"/property name="debug" 
value="true"/

target 
name="clean"deletefilesetincludes 
name=".\bin\${basename}*.dll" 
//fileset/delete/target

target 
name="buildpublisher"csc target="library" 
output=".\bin\${basename}Publisher.dll" 
debug="${debug}"sourcesincludes 
name="${basename}Publisher.cs" 
//sources 
resources 
includes name=".\bin\${basename}Document.dll" 
/ 
/resources/csc/target

target 
name="builddocument"csc target="library" 
output=".\bin\${basename}Document.dll" 
debug="${debug}"sourcesincludes 
name="${basename}Document.cs" 
//sources/csc/target

target name="buildall" 
depends="builddocument,buildpublisher" 
//project