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.
I have a ASP.NET MVC App that references a Managed C++ dll which invokes a Native C++ DLL (Yes that same scenario I asked a different question about already).
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 Delay Loading
so my MVC app's Application_Start
runs before the dependency is resolved, I used Application_Start
to set the PATH
environment variable and it worked great.
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 Application_Start
but I continue to see the 'Could not load assembly' error. Why is Azure different?
Click Here to download the test solution Click Here to download the code for Managed C++ DLL with Delay Loading enabled