Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7783911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:58:51+00:00 2026-06-01T19:58:51+00:00

Regsvr32 fails as a post build event for a DLL project. Post Build Event:

  • 0

Regsvr32 fails as a post build event for a DLL project.

Post Build Event:
regsvr32 /s /c “$(TargetPath)” (also tried without quotes).

Removing the /s results in the error message
LoadLibrary(“…”) failed – The specified module could not be found.

If I run regsvr32 from command prompt the result is successful. If I copy and run or even directly run the “BAT000019.bat” file I get the resulting message “DllRegisterServer in …dll succeeded.” I have loaded the DLL in Dependency Walker and found no issues. This has worked in the past, but suddenly started having issues. I have about 50 projects which have the same post build event, only about 3 have this issue. The DLL file does exist at the time the bat file is generated (maybe it’s in use???).

I don’t see any issues with the generated bat file:

@echo off
regsvr32 /c "C:\ ... .dll"
if error level 1 goto VCReportError
goto VCEnd
:VCReportError
echo Project : error PRJ0019: A tool returned an error code from "Performing registration"
exit 1
:VCEnd

Other information:
OS: Windows XP SP3.
IDE: VS 2003 Pro (up to date).
Language: C++

I could just remove the post build event, but would rather keep it for some of our newer program debuggers.

Anyone have any thoughts on how to fix this?

Other things I’ve tried:
Relative path to DLL in post build event. (fails)
Absolute path to DLL in post build event. (fails)
With an without quotes (nothing in the absolute path contains a space). (fails)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:58:54+00:00Added an answer on June 1, 2026 at 7:58 pm

    I think your project isn’t made by just one DLL, maybe the DLL you’re building depends on other libraries (check with DependencyWalker andverify if LoadLibrary/GetProcAddress too) but they’re not there for the post-build event of the dll.

    If you run from the command prompt in the output directory there is everything your dll needs so it can be registered.

    For what I know you can’t set a post-build event for the solution so please check your project dependencies/build order). I assume you’re not trying to register a dll alone in its output directory without its dependencies (the path in the batch should match $(TargetPath))

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My project generates a dll and when build in Debug mode the dll gets
When I tried to register a COM DLL, regsvr32 rpcrt4.dll I get the following
When I tried to unregister a dll : regsvr32 /u IPCamFilter1.ax A message box
We are getting the error below calling c:\windows\syswow64\regsvr32.exe on Windows Server 2008 R2 x64.
I have written a COM dll, and wish to register it using regsvr32 myComdll.dll
This is driving me nuts. I registered a DLL (COM) using regsvr32 blabla.dll In
Right, initially ran: c:\regsvr32 Amazing.dll then, (accidentally - I might add) I must have
I am building a C# ActiveX DLL... do I use REGASM or REGSVR32 to
I have tried to use the following code: cd c:\windows\system32 regsvr32.exe dllname.ax But this
I use regsvr32 MyCOM.dll to register my com object for my application. This works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.