سؤال

I have a 3rd party web page screen capture DLL from http://websitesscreenshot.com/ that lets me target a URL and save the page to a image file. I've moved this code into my Azure-based project and when I run it on my local sandboxed dev box and save to the Azure blob, everything is fine. But when I push the bits to my live server on Azure, it's failing.

I think this is because either MSHTML.dll and/or SHDOCVW.dll are missing from my Azure configuration.

How can I get these libraries (plus any dependent binaries) up to Azure?

I found the following advice on an MSFT forum but haven't tried it yet. http://social.msdn.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/0344dcff-6fdd-4479-a3b4-3e89750a92f4/

Hello, I haven't tried mshtml in the cloud. But generally speaking, to use a native dll in a Web Role, you add the dll to the Web Role project just like adding a picture (choose add existing items). Then make sure the Build Action is set to Content. This tells Visual Studio to copy the dll file to the output package.

Also check dependencies carefully. A lot of problems related to native code are caused by missing dependencies, such as a particular VC++ runtime dll.

Thought I'd ask here first before I burn a day or two on an unproven solution.

EDIT #1: it turns out that our problem was not related to MSHTML.dll or SHDOCVW.dll missing from the Azure server. They're there.

The issue is that by default new server instance have the IE security hardening feature enabled, and this was preventing our 3rd party dll from executing script. So we needed to turn off the enhanced IE security configuration settings. This is also a non-trivial exercise.

In the meantime, we just created a server-side version of the feature on our site we need to make screen captures from (e.g. we eliminated JSON-based rendering of UI on the client), and we were able to proceed.

هل كانت مفيدة؟

المحلول

I think the solution mentioned in the MSDN forum thread is correct. You should put them as part of your project files, so that the SDK will package and deploy them to the VM on the cloud.

But if they are COM and need to be registed you'd better call the register command via the Startup feature. Please check http://msdn.microsoft.com/en-us/hh351539

HTH

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top