I am building a job-running system that has one .NET Core console app as a job runner, and user-extensible jobs - users can reference my NuGet package, write a class that extends my Job type, and implement the Execute method. I want to provide all the console logic in the NuGet package such that referencing it will allow for building a ready-to-run console app. I've been able to use NuGet to publish the required build targets to build the app, but I'm looking for a way to actually load the job dll.
My current solution is:
- Job-runner loads all dlls in its working directory via reflection
- Job-runner inspects all those dlls for one that implements the required type
- Job-runner creates an instance of the job type and executes the job
I would like to avoid step 1, which I believe I would be able to do if the NuGet package simply provided an entry point for a console app. Is it possible to either build a console app without an entry point and supply it via NuGet, or use a class library and have all the requisite dlls loaded in one appdomain?
Aucun commentaire:
Enregistrer un commentaire