title: Matlab Builder NE / MCR .Net dll in an Azure worker role
body: <p>I have compiled a MATLAB function using R2013a into a .NET dll using Builder NE.</p>
  
  <p>I can reference the dll and call the function successfully from a C# Console app. </p>
  
  <p>But the same code fails when running in a worker role through an Azure Cloud Service project. The application just crashes out silently and stops debugging at the line that initializes the class in the dll. There is this message in the Debug Output window:</p>
  
  <blockquote>
    <p>"The program '[8620] WaWorkerHost.exe: Managed (v4.0.30319)' has exited with code -529697949 (0xe06d7363) 'Microsoft C++ Exception'."</p>
  </blockquote>
  
  <p>I have tried a couple of things in the project properties:
  Set the Platform target to x64; 
  Unchecked 'Enable the Visual Studio hosting process"</p>
  
  <p>It fails both running in the Azure Emulator on my dev machine, and when deployed to an Azure worker role on a Cloud Service. Yet when I execute a console app that calls the same dll via Process.Start it calls the MATLAB/MCR/.Net dll successfully. (I have a startup task that silently installs the MATLAB MCR)</p>