title: Azure App Service hits the entry-points of references before running Application_Start
body: <p>EDIT: I was able to reproduce this behavior on my local computer by debugging using IIS not IIS Express, and I was able to solve it by setting my IIS App Pool to `Allow 32-bit Applications'; My Azure website is using 32-bit platform, I don't know what else I can do up there. It does not look like Azure is a good fit for my application.</p>
  
  <p>I have a ASP.NET MVC App that references a Managed C++ dll which invokes a Native C++ DLL (Yes that same scenario <a href="https://www.dropbox.com/s/8v0d4il640d1dei/TestMvcService%201.zip?dl=0" rel="nofollow noreferrer">I asked a different question about already</a>). </p>
  
  <p>When I first ran the app, I got the error that that Native dll was not found because it wasn't part of the Shadow Copy. So I learned that the Managed C++ dll that is referencing the Native DLL needs to use a linker option called <code>Delay Loading</code> so my MVC app's <code>Application_Start</code> runs before the dependency is resolved, I used <code>Application_Start</code> to set the <code>PATH</code> environment variable and it worked great.</p>
  
  <p>The problem is, I couldn't get it to work on Azure App Service. I continue to see the dependency resolving behavior running first. I added a test line to throw a test exception on <code>Application_Start</code> but I continue to see the 'Could not load assembly' error. Why is Azure different?</p>
  
  <p><a href="https://www.dropbox.com/s/8v0d4il640d1dei/TestMvcService%201.zip?dl=0" rel="nofollow noreferrer">Click Here</a> to download the test solution
  <a href="https://www.dropbox.com/s/zki3phpxjau2b37/amzinet.zip?dl=0" rel="nofollow noreferrer">Click Here</a> to download the code for Managed C++ DLL with Delay Loading enabled</p>