Azure COM Objects

会有一股神秘感。 提交于 2019-12-30 04:40:10

问题


I am trying to move a website I am hosting on a server with IIS over to an Azure web site. I'm using a COM object but I'm not sure if I can register this? I found some posts talking about uploading the dll and registering it on start up but the article seems to be missing. Is this possible?


回答1:


I had this exact problem registering legacy COM Components on Azure. I documented my methodology here:

AspPDF and AspJPEG on Windows Azure

Igorek is correct, you will need to use a Web Role to achieve this. The solution above is based on a single Web Role with a startup script to run regsvr32 as a startup task.

To summarise, there are essentially two parts to achieving this. First create a batch file to run the regsvr32 command:

chcp 1252>NUL
regsvr32 /s .\library\my-com-class.dll
exit /b 0

Then define a startup task in your ServiceDefinition.csdef file:

<Startup>
<Task commandLine="mybatchfile.cmd" executionContext="elevated" taskType="simple" />
</Startup>

This will trigger the command file to run on deployment.




回答2:


You cannot register a COM object within an Azure Website. You will need to upgrade to Web Roles in order to do this. Registration of com object can happen during the startup scripts then.



来源:https://stackoverflow.com/questions/16039950/azure-com-objects

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!