Search code examples
c#azuredllcomazure-cloud-services

Deploy com dependent app to azure cloud


I'm trying to deploy c# app which references at COM DLL. I know that Azure Cloud VMS are x64, so COM lib I referenced to is x64 too. I've added .cmd file and linked it in ServiceDefinition. And looks like it is executed, because if I'm deleting .cmd file I'm getting an error of missing it. I'm not sure about one thing: which library I should register? I mean I have a someCOM.dll. I'm referencing it in my c# project and I'm getting someCOMLib.dll in my references list. But my project doesn't contain any someCOMLib.dll. It is contain Interop.someCOMLib.dll So I've tried to register original someCOM.dll but I'm getting error

Retrieving the COM class factory for component with CLSID {D1F73A20-01A1-431B-A135-2D2A89A3D2B3} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

And if I'm doing everything right is there any other things I may be missed?


Solution

    1. someCOM.dll was dependent on other libs, so I added them to my projects folder with someCOM.dll. That was the most problem, because all worked fine on my machine without any additional work. That was because it is a 3rd party solution so I think their installer did all the job.
    2. I saved my .cmd in notepad and it saved in UTF-8 by default. So when I tried to execute this cmd I get some strange symbols somewhere between my commands, so it failed.

    To sum up there is some advices to somebody who face this problem and has zero level of COM etc. subject knowledge:

    1. remove /s flag in your .cmd and execute it from your command line with admin rights. Don't forget to return /s flag back on deploy.
    2. You will see your problem .dll guid on the error page after deploy. Just visit yout host address (with <customErrors mode="Off"> in Web.config)
    3. Open regedit and find guid of problem .dll. There may be some helpful info.