简体   繁体   English

Azure DevOps 管道构建 - 注册 COM DLL

[英]Azure DevOps Pipeline Build - register COM DLL

Background: Few Projects in my solution, are dependent on COM libraries.背景:我的解决方案中很少有项目依赖于 COM 库。 So these COM DLLs has to be registered before building the actual solution.因此,必须在构建实际解决方案之前注册这些 COM DLL。

In Azure DevOps - Pipeline - Build - Task, I added a "Command Line" agent job, with the following command,在 Azure DevOps - Pipeline - Build - Task 中,我添加了一个“命令行”代理作业,使用以下命令,

Scenario 1:场景一:
C:\\windows\\system32\\regsvr32.exe /s [DLLFilePath]\\[DLLName].dll C:\\windows\\system32\\regsvr32.exe /s [DLLFilePath]\\[DLLName].dll

Scenario 2:场景2:
CD [DLLFilePath] CD [DLL文件路径]
C:\\windows\\system32\\regsvr32.exe /s [DLLName].dll C:\\windows\\system32\\regsvr32.exe /s [DLLName].dll

But both the scenarios return the same error during build time,但是这两种情况在构建期间都返回相同的错误,
[error]Cmd.exe exited with code '3'. [错误]Cmd.exe 退出,代码为“3”。

Note:笔记:
The DLL is copied to the above mentioned location using a seperate agent job, before invoking regsvr32.在调用 regsvr32 之前,使用单独的代理作业将 DLL 复制到上述位置。
[DLLFilePath]\\[DLLName].dll is a local path in the build agent, say c:\\..\\someLibrary.dll [DLLFilePath]\\[DLLName].dll 是构建代理中的本地路径,比如 c:\\..\\someLibrary.dll

In my project a have same problem (I think).在我的项目中有同样的问题(我认为)。 Error after build: COM library no registered.构建后出错:COM 库未注册。

But I registered my COM library with C:\\windows\\system32\\regsvr32.exe and registered x64 dll.但是我用 C:\\windows\\system32\\regsvr32.exe 注册了我的 COM 库并注册了 x64 dll。

My solution: I change BuildPlatform from "Any CPU" to "x64".我的解决方案:我将 BuildPlatform 从“Any CPU”更改为“x64”。 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM