7
votes

Background: Few Projects in my solution, are dependent on COM libraries. So these COM DLLs has to be registered before building the actual solution.

In Azure DevOps - Pipeline - Build - Task, I added a "Command Line" agent job, with the following command,

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

Scenario 2:
CD [DLLFilePath]
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'.

Note:
The DLL is copied to the above mentioned location using a seperate agent job, before invoking regsvr32.
[DLLFilePath]\[DLLName].dll is a local path in the build agent, say c:\..\someLibrary.dll

1
Did you ever find a solution for this? It's something that I want to attempt looking into. I've got a decent number of PCs I want to deploy a DLL to without having to manually re-register every time I make a change.Webbarr
Don't know if this will be helpful but Ray Chen has a full post on error 3 resulting from RegSvr32.exe. Granted it's not related to Azure Pipelines but probably is relevant: devblogs.microsoft.com/oldnewthing/20180921-00/?p=99795Joe
Also I know that that regsvr32 does not work unless I do it as administrator. Not sure how to do that in an Azure DevOps pipelineJoe

1 Answers

0
votes

In my project a have same problem (I think). Error after build: COM library no registered.

But I registered my COM library with C:\windows\system32\regsvr32.exe and registered x64 dll.

My solution: I change BuildPlatform from "Any CPU" to "x64". enter image description here