How can I replace an Event Processor without restarting the Records Manager service on the server?


With Records Manager we use some Event Processors. Recently I was asked to change part of the code of one of those Events and now I need to pass it to the production server. The problem I have is that the current .dll file is blocked by the Records Manager service on the server. I know that if I stop the Records Manager service, the dll file will be released and I will be able to replace it, but stopping the service implies leaving all users without access for some time and that is a scenario that I want to avoid. Records Manager is constantly used 24 hours a day, 7 days a week, so stopping the service is not an option I want to opt for.

Is there any way to release that dll file so I can replace it that does not involve restarting the Records Manager service on the server?

Thank you in advance for your help.

  • Verified Answer

    Following (because I want to see if there's a better way but I'm not too hopeful).

    I don't think there's a way around stopping the trimworkgroup service while you update this. I use a script to minimise the downtime but unless you configure your events to run on a server that no end users connect to, then a short outage is unavoidable. Also remember to have enterprise studio closed when updating! That tripped me up the other day - couldn't work out what was keeping a lock on the DLL after I'd shut down the service!

    If it helps, here's the script I'm using at the moment.

    # Servers to update $wgs = 'TRIMUAT01','TRIMUAT02','TRIMUAT03','TRIMUAT04' # Path to new version of DLL $newDLL = "D:\INSTALL\TRIM\CustomEventProcessor\20191126\TRIM.CustomEventProcessor.dll" # Deploy new DLL to each server $wgs | % { Write-Host "Updating $_..." -ForegroundColor Yellow -BackgroundColor Black # Stop the TRIM services Invoke-Command -ComputerName $_ -ScriptBlock { Get-Service -Name TRIMWorkgroup | Stop-Service -Confirm:$false -Verbose } Invoke-Command -ComputerName $_ -ScriptBlock { Get-Process -Name TRIMEvent -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue -Verbose } # Copy the new DLL Copy-Item -Path $newDLL -Destination "\\$_\C$\Program Files\Micro Focus\Content Manager\$(Split-Path $newDLL -Leaf)" -Force -Verbose # Start the services Invoke-Command -ComputerName $_ -ScriptBlock { Get-Service -Name TRIMWorkgroup | Start-Service -Verbose } Write-Host "`n" }


  • The problem is that the WGS locks your Dll containing your add-in class so...

    A possible solution would be to have 2 (or more) .dlls.  The first containing your entry point and will be permanently loaded.  The second one containing your system functions is dynamically loaded and unloaded for each call to ProcessEvent(). 

    This way you can replace the second one when it is not being used.  This is not safe though: if you're replacing it at the same time it tries to get loaded you'll be in a spot.  You'll have to build the loading code to anticipate this issue and perform an appropriate retry.  This is just a thought - have now done it myself.





  • Hi Davros

    Thanks for your help. I find the script you share to me very useful. I will implement it to have a minor impact on the service restart. Thank you very much.

  • Hi Quinton,

    It is a great idea to implement the function libraries in this way. I will make the changes to the codes I have so that with future changes I do not need to restart the Records Manager service.

    Thank you