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