0

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

fahadash
  • 3,133
  • 1
  • 30
  • 59
  • People shouldn't have to click to download any solution or code. How about editing your question to just include the relevant parts of your code? – David Makogon Mar 13 '17 at 19:44
  • Possible duplicate of [Native DLL dependencies with ASP.NET MVC Projects](http://stackoverflow.com/questions/42740090/native-dll-dependencies-with-asp-net-mvc-projects) – fahadash Mar 15 '17 at 02:57

0 Answers0