title: Azure SDK 1.7 Storage Emulator - Queue Storage won't start - using Storage Client with dev env custom ports
body: <p>Problem: Azure Storage Emulator could start Blob and Table storage, but Queue Storage would fail to start, showing an error dialog:
  "File is in use by another Process" 
  found resolution to that issue, but now I'm having issues with my development environment storage client.  Here's what I've done...</p>
  
  <p>port 10001 is the default port for the Queue Storage, so based on some related articles I did (the last column in output is the PID of the process):</p>
  
  <pre><code>    c:\...&gt; netstat -p tcp -ano | findstr :1000
    TCP    0.0.0.0:10001          0.0.0.0:0              LISTENING       2628
    TCP    127.0.0.1:10000        0.0.0.0:0              LISTENING       4
    TCP    127.0.0.1:10002        0.0.0.0:0              LISTENING       4
  </code></pre>
  
  <p>the big problem here is that what is listening on 10001 is McAfee and i cannot change that.</p>
  
  <p>the next step is to reconfigure the Queue storage to not use 10001:
  reconfigure the storage emulator to listen on an available port.  Open:</p>
  
  <pre><code>%PROGRAMFILES%\Microsoft SDKs\Windows Azure\Emulator\devstore\DSServiceLDB.exe.config
  </code></pre>
  
  <p>in your favorite text editor and change the binding for the queue storage... in my case, 10003 was available:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;    
      &lt;section name="developmentStorageConfig" type="Microsoft.ServiceHosting.DevelopmentStorage.Utilities.DevelopmentStorageConfigurationHandler, DevelopmentStorage.Common"/&gt;
    &lt;/configSections&gt;
  
    &lt;developmentStorageConfig&gt;
      &lt;services&gt;
        &lt;service name="Blob" url="http://127.0.0.1:10000/"/&gt;
        &lt;service name="Queue" url="http://127.0.0.1:10003/"/&gt; &lt;!-- this line here --&gt;
        &lt;service name="Table" url="http://127.0.0.1:10002/"/&gt;
      &lt;/services&gt;
  ...
  </code></pre>
  
  <p>shutodwn and start the storage emulator and all should be good:</p>
  
  <pre><code>c:\...netstat -p tcp -ano | findstr :1000
    TCP    0.0.0.0:10001          0.0.0.0:0              LISTENING       2628
    TCP    127.0.0.1:10000        0.0.0.0:0              LISTENING       4
    TCP    127.0.0.1:10002        0.0.0.0:0              LISTENING       4
    TCP    127.0.0.1:10003        0.0.0.0:0              LISTENING       4
  </code></pre>
  
  <p>now, trying to configure my client in VS2012 isn't working...
  I have modified my configuration File: ServiceConfiguration.Cloud.cscfg
  with the following setting:</p>
  
  <pre><code>&lt;Setting name="StorageConnectionString" value="BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10003/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount;AccountName=devstoreaccount;AccountKey=key copied from storage config file" /&gt;
  </code></pre>
  
  <p>but i get a 404 when i try to connect to the queue and call create if not exist:</p>
  
  <pre><code>    storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
      queueClient = storageAccount.CreateCloudQueueClient();
      queue = queueClient.GetQueueReference("testqueue");
      queue.CreateIfNotExist();
  </code></pre>
  
  <p>so after some time of tweaking on this...
  I looked at what the storage client was doing if you were using the development settings and I replicated the code with a System.Diagnostics.Debugger.IsAttached block.  I also noticed my naming of the queue was bad (once i got the client to connect, it was giving back a 400 error):</p>
  
  <pre><code>if (System.Diagnostics.Debugger.IsAttached)
          {
              var blobEndpoint = new Uri("http://127.0.0.1:10000/devstoreaccount1");
              var queueEndpoint = new Uri("http://127.0.0.1:10003/devstoreaccount1");
              var tableEndpoint = new Uri("http://127.0.0.01:10002/devstoreaccount1");
              var storageCreds = new StorageCredentialsAccountAndKey("devstoreaccount1", "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==");
  
              _storageAccount = new CloudStorageAccount(storageCreds, blobEndpoint, queueEndpoint, tableEndpoint);
          }
          else
          {
              _storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
          }
          _queueClient = _storageAccount.CreateCloudQueueClient();
          /* Queue naming rules:
           *  1. A queue name must start with a letter or number, and can only contain letters, numbers, and the dash (-) character. 
              2. The first and last letters in the queue name must be alphanumeric. The dash (-) character cannot be the first or last character. Consecutive dash characters are not permitted in the queue name.
              3. All letters in a queue name must be lowercase.
              4. A queue name must be from 3 through 63 characters long.
           */
          _queue = _queueClient.GetQueueReference("myqueuename");
          _queue.CreateIfNotExist();  
  </code></pre>