Your first suggestion is a little different because it involves a custom program running on the server. That responds to a request to register a DLL, for example, from another remote program.

So, if you are able to have a program running all the time on your server, that should be all you need.