R – Max number of times a DLL can be registered/unregistered

comcruisecontrol.netdllnant

Is there a maximum number of times that a DLL can be registered and unregistered in a specific time period?

Here's what I mean and why: I have a Continuous Integration package that builds my VB6 applications and in order to build each of the 80 components of the solution, I:

  1. retrieve each project's dependencies
    in turn
  2. register the dll (in NAnt
    using < comregister unRegister="false" … … >)
  3. build the project
  4. publish the output .dll or .exe
    somewhere safe
  5. un-register the dll (in NAnt using
    < comregister unRegister="true" …
    … >)

Now, this all works 100% of the time, IF I build each of the 80 projects manually; however, if I get my NAnt script to build all 80 projects in turn (in the correct order) then the build fails, giving me this error in CruiseControls' output…

[comregister] Unregistering 1 files
[comregister] c:\location\myBuild.include(301,4): Error while unregistering 'c:\\[project-location]\lib\myDependentDLLFile.dll' Unable to find an entry point named '**DllUnregisterServer**' in DLL 'c:\\[project-location]\lib\myDependentDLLFile.dll'.

(I don't know where 'DllUnregisterServer' comes from though!)

The same error then appears for every subsequent project that I build past the point of failure, which is around the 50-projects-built area. What I mean, is that the first 50 projects build fine, then the rest fail in-turn.

I have mitigated this by using the failonerror="false" attribute within the comregister call inside NAnt, but this then throws doubt in my mind as to whether this is ok or not…!

Ideally, I'd like to remove the failonerror attribute and report genuine errors back to CruiseControl's logging facilities. Any thoughts or suggestions?

Best Answer

No there's no maximum. Use Dumpbin.exe or Depends.exe to take a look inside that DLL and check that DllUnRegisterServer entry point is actually defined.

Related Topic