title: nant task to create queue with c# code
body: <pre><code>&lt;project name="aa" default="createqueue" xmlns="http://nant.sf.net/release/0.85/nant.xsd"&gt;
  &lt;target name="createqueue"&gt;
  &lt;echo message="started" /&gt;
      &lt;script language="C#" &gt;
              &lt;references&gt;
                  &lt;lib&gt;
                      &lt;include name="C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Messaging.dll" /&gt;
                  &lt;/lib&gt;
              &lt;/references&gt;
              &lt;imports&gt;
                    &lt;import namespace="System" /&gt;
                    &lt;import namespace="System.Messaging" /&gt;
              &lt;/imports&gt;
              &lt;code&gt;
                  &lt;![CDATA[
                  public static void ScriptMain(Project project)
                      {
                          string queueName = @".\Public$\TicketMatchingService";
                          if (!MessageQueue.Exists(queueName))
                          {
                              MessageQueue.Create(queueName, true);
                          }
                      }
                  ]]&gt;
              &lt;/code&gt;
      &lt;/script&gt;
      &lt;echo message="ended" /&gt;
  &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I am getting the following error message</p>
  
  <pre><code>C:\queuetask.build(4,3):
  Compilation failed:
  c:\Documents and Settings\refundspair1\Local Settings\Temp\pnf11egc.0.cs(17,14) : error CS0234: The type or namespace name 'Messaging' does not exist in the namespace 'System' (are you missing an assembly reference?)
  //------------------------------------------------------------------------------
  // &lt;auto-generated&gt;
  //     This code was generated by a tool.
  //     Runtime Version:2.0.50727.3603
  //
  //     Changes to this file may cause incorrect behavior and will be lost if
  //     the code is regenerated.
  // &lt;/auto-generated&gt;
  //------------------------------------------------------------------------------
  
  using NAnt.Core;
  using NAnt.Core.Attributes;
  using System;
  using System.Collections;
  using System.Collections.Specialized;
  using System.IO;
  using System.Messaging;
  using System.Text;
  using System.Text.RegularExpressions;
  
  
  
  [FunctionSet("script", "script")]
  public class nant0aac150cbd424d3c93af8adc13adf050 : NAnt.Core.FunctionSetBase {
  
  
      public static void ScriptMain(Project project)
       {
        string queueName = @".\Public$\TicketMatchingService";
        if (!MessageQueue.Exists(queueName))
        {
         MessageQueue.Create(queueName, true);
        }
       }
  
  
      public nant0aac150cbd424d3c93af8adc13adf050(NAnt.Core.Project project, NAnt.Core.PropertyDictionary propDict) :
              base(project, propDict) {
      }
  }
  
  Total time: 0.3 seconds.
  </code></pre>