title: Unhandled exception at 0x ... in w3wp.exe: 0x ... : A heap has been corrupted
body: <p>I'm building a project in Visual Studio 2012. When I press <kbd>F5</kbd> to run the app, it works just fine, however when I load it up in IIS7 on my Windows Pro box, the first time I make a call to a specific code base, I get the following error.</p>
  
  <blockquote>
    <p>The thread 'Win32 Thread' (0x4d8) has exited with code 0 (0x0).<br>
    <br>
    Unhandled exception at 0x7797e6c3 in w3wp.exe: 0xC0000374: A heap has been corrupted.<br>
    <br>
    First-chance exception at 0x778e32a0 in w3wp.exe: 0xC0000005: Access violation reading  location 0x2039a9f2.<br>
    <br>
    Unhandled exception at 0x778e32a0 in w3wp.exe: 0xC0000005: Access violation reading location 0x2039a9f2.</p>
  </blockquote>
  
  <p>Now I've attached the <code>w3wp.exe</code> to the VS2012 debugger, but to be honest, I'm not sure how to debug this type of crash.</p>
  
  <p>For reference, the code base that's being called in a WebAPI controller that makes a call to the ActiveHome SDK to control some automation bits.</p>
  
  <pre><code>            // GET api/&lt;controller&gt;/5
      public StatusModel Post(CommandModel command)
      {
          var activeHome = new ActiveHomeClass();
          // execute command
          var info = activeHome.SendAction(command.SendAction, String.Format("{0} {1}", command.Device, command.Command));
  
          // return results
          var status = new StatusModel { Device = command.Device, Status = info };
  
          activeHome = null;
  
          return status;
      }
  </code></pre>
  
  <p><em>Note: I am compiling everything to use x86</em></p>