0

I would like to run a native httpmodule (c++ 64-bit dll) in windows azure. Firstly is this possible and secondly, what id the best way to go about it?

I have previously used a native dll in azure but wrapped it within a managed c# httphandler which worked fine but this time I would like to host the native dll directly. Is it possible to just host the native dll in azure same as I would in IIS?

2 Answers2

0

I believe you are using a Windows Azure Web Role and on Windows Azure Web Role, native HttpModule configuration with IIS will be the same as and other IIS server the only trick here is that you would be using Startup task to run AppCmd command to install, register and configure your native module.

The basic command you would need in your startup task will be similar to as below:

appcmd install module /name: string /image: string /add:true|false /lock:true|false

For example, to register, enable, and lock a module named ImageCopyrightModule with the .dll file in the %windir%\system32\inetsrv directory, type the following at the command prompt, and then press ENTER:

appcmd install module /name: ImageCopyrightModule /image:c:/%windir%/system32/inetsrv/ imageCopyrightModule .dll /add:true /lock:true
AvkashChauhan
  • 20,495
  • 3
  • 34
  • 65
0

Yes It's possible, I recently had to use an unmanaged C library in my Azure project so what I did was to create a C++/CLI wrapper for it and simply reference it in my C# project.
I believe that's the easiest way to do it, otherwise you'll need to use P/Invoke to call the unmanaged native code directly from C#.

Remember that on the cloud side, Azure uses the 2008 Visual C++ runtime library so you'll either have to compile your C++ project using VS2008, or a better alternative would be to upload the Visual C++ 2010 Redistributable Package to the cloud and silently install it on start-up.

I list the 3 simple steps to do that here If you're interested.

Community
  • 1
  • 1
Shahin Dohan
  • 6,149
  • 3
  • 41
  • 58