I am Updating all C++ projects platform toolset from Visual Studio 2012 to Visual Studio 2019.
When I am trying to perform registration of the DLL which was created during Build, it is giving below error.
In project properties -> Custom Build Step i have added the below command to perform registration,
regsvr32 /s /c "$(TargetPath)" echo regsvr32 exec. time > "$(OutDir)regsvr32.trg"
1>Performing registration
1>C:Program Files (x86)Microsoft Visual Studio2019CommunityMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(286,5): error MSB3073: The command "regsvr32 /s /c "D:newomniaOmniasourcecppDependentFilesMGNortelGPRSPreProcessor.dll"
1>C:Program Files (x86)Microsoft Visual Studio2019CommunityMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(286,5): error MSB3073: echo regsvr32 exec. time > "........DependentFilesregsvr32.trg"
1>C:Program Files (x86)Microsoft Visual Studio2019CommunityMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(286,5): error MSB3073:
1>C:Program Files (x86)Microsoft Visual Studio2019CommunityMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(286,5): error MSB3073:
1>C:Program Files (x86)Microsoft Visual Studio2019CommunityMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(286,5): error MSB3073: :VCEnd" exited with code 3.
On clicking the error, it navigates to below tags within Microsoft.CppCommon.targets
<Exec Command="%(CustomBuildStep.Command)$(_BuildSuffix)"
StdOutEncoding = "%(CustomBuildStep.StdOutEncoding)"
StdErrEncoding = "%(CustomBuildStep.StdErrEncoding)" />
I am able to build and register the other projects. only few projects having this issue.
The path of the DLL was in the location i specified. I even tried to directly be registering from the command prompt (As admin). still, it is failing.
Can someone please help in this.
2
Answers
Looks like you are registering 32bit all in 64 bit OS:
You have to go to:
cd C:WindowsSysWOW64
then register using:
regsvr32 "D:newomniaOmniasourcecppDependentFilesMGNortelGPRSPreProcessor.dll"
From How to use the Regsvr32 tool:
The 32-bit version is %systemroot%SysWoW64regsvr32.exe.
The error means
MGNortelGPRSPreProcessor.dll
is missing dependent libraries. Make sure that the DLLs required byMGNortelGPRSPreProcessor.dll
are in the same folder or system environment path.In addition, consider using post-build event.