title: MSBuild custom Task with variable no of input parameters
body: <p>I've done a couple of custom Tasks in <a href="http://en.wikipedia.org/wiki/MSBuild" rel="nofollow">MSBuild</a>, but I am facing a new situation here.</p>
  
  <p>In short, I want to do this:</p>
  
  <pre><code>&lt;Target Name="MyTarget"&gt;
    &lt;CustomTask Files=""&gt;
       &lt;Input Name="SomeName" Action="SomeActionName /&gt;
       &lt;Input Name="SomeName" Action="SomeActionName /&gt;
       &lt;Input Name="SomeName" Action="SomeActionName /&gt;
    &lt;/CustomTask&gt;
  &lt;/Target&gt;
  </code></pre>
  
  <p>I want to do this as I find it more readable than using Itemgroups/propertygroups.
  There is an attribute such as <strong>Output</strong> which is almost what I need. It should just be <strong>Input</strong> instead (hence the name).</p>
  
  <p>So far I've attempted solving this issue using two tasks: CustomTask and InputTask.</p>
  
  <p><em><strong>Please note that Input does not have to be a Task. This was just a test and a means of getting a variable sized collection of inputs.</em></strong></p>
  
  <pre><code>public class CustomTask : Task
  {
      [Required]
      public TaskItem[] Files { get; set; }
  
      public InputTask[] Subs { get; set; }
  
      public override bool Execute()
      {
          if(Subs != null)
          {
              Subs.ToList().ForEach(sub =&gt; sub.Execute());
          }
          else
          {
              Log.LogMessage("No Subs");
          }
          return true;
      }
  }
  
  public class InputTask: Task
  {
      [Required]
      public TaskItem Name{ get; set; }
  
      [Required]
      public TaskItem Action{ get; set; }
  
      public override bool Execute()
      {
          Log.LogMessage("" + Name + " should " + Action);
          return true;
      }
  }
  </code></pre>
  
  <p>The idea was that MBSuild could "detect" the sub tasks and would then hand me a collection of them, but I just get an MSB4067 error.</p>
  
  <p>I've have looked through a lot of the online OS tasks and the official documentation, but I haven't found any such example.</p>
  
  <p><strong>Is this even possible to do this way?</strong></p>
  
  <p><strong>If not, how would you recommend I solve this (PropertyGroup/ItemGroup/Other)?</strong></p>