[Mono-bugs] [Bug 516323] New: xbuild can't handle enum properties in tasks

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jun 25 02:37:28 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=516323


           Summary: xbuild can't handle enum properties in tasks
    Classification: Mono
           Product: Mono: Tools
           Version: 2.4.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: P5 - None
         Component: xbuild
        AssignedTo: jankit at novell.com
        ReportedBy: mitchell.wheeler at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.10)
Gecko/2009042805 Iceweasel/3.0.6 (Debian-3.0.6-1)

When attempting to use a task, which contains an enum property - xbuild cannot
convert from the string in the msbuild file, to the enum type - instead just
throwning an exception.



Reproducible: Always

Steps to Reproduce:
1. Create a task which has a property of type enum
2. Create msbuild file, using that task - and the enum property (with the value
set to the string name of one of the enum's values)
3. Attempt to compile msbuild file, see exception below.
Actual Results:  
(Note: Polychrom.Build.Tasks.CCTarget is an enum)

Target Build:
System.Exception: Unknown type: Polychrom.Build.Tasks.CCTarget
  at Microsoft.Build.BuildEngine.ExpressionCollection.ConvertToObject
(System.String raw, System.Type type) [0x00000] 
  at Microsoft.Build.BuildEngine.ExpressionCollection.ConvertToNonArray
(Microsoft.Build.BuildEngine.Project project, System.Type type) [0x00000] 
  at Microsoft.Build.BuildEngine.ExpressionCollection.ConvertTo
(Microsoft.Build.BuildEngine.Project project, System.Type type) [0x00000] 
  at Microsoft.Build.BuildEngine.Expression.ConvertTo
(Microsoft.Build.BuildEngine.Project project, System.Type type) [0x00000] 
  at Microsoft.Build.BuildEngine.TaskEngine.GetObjectFromString (System.String
raw, System.Type type) [0x00000] 
  at Microsoft.Build.BuildEngine.TaskEngine.Prepare (ITask task,
System.Xml.XmlElement taskElement, IDictionary`2 parameters, System.Type
taskType) [0x00000] 
  at Microsoft.Build.BuildEngine.BuildTask.Execute () [0x00000] 


Expected Results:  
I'd expect xbuild to use something like:

TaskProperty = Enum.Parse(TaskPropertyType, XmlAttributeValue); // to convert
from the string value in the msbuild file, to the appropriate type.

Note: I'm not entirely sure if this is a 'bug' (I haven't tested msbuild itself
to see if it can handle this case, but it seems like something it should handle
without any issues)

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list