Azure COM 对象 [英] Azure COM Objects
问题描述
我正在尝试将我在带有 IIS 的服务器上托管的网站转移到 Azure 网站.我正在使用 COM 对象,但我不确定是否可以注册它?我发现一些帖子谈论上传 dll 并在启动时注册它,但文章似乎丢失了.这可能吗?
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?
推荐答案
我在 Azure 上注册旧 COM 组件时遇到了这个问题.我在这里记录了我的方法:
I had this exact problem registering legacy COM Components on Azure. I documented my methodology here:
Windows Azure 上的 AspPDF 和 AspJPEG
Igorek 是正确的,您需要使用 Web 角色来实现这一点.上面的解决方案是基于单个 Web 角色和一个启动脚本来运行 regsvr32 作为启动任务.
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.
总而言之,实现这一目标主要有两个部分.首先创建一个批处理文件来运行regsvr32命令:
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 .librarymy-com-class.dll
exit /b 0
然后在您的 ServiceDefinition.csdef 文件中定义一个启动任务:
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.
这篇关于Azure COM 对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!