elsa-workflows / elsa-core

A .NET workflows library
https://v3.elsaworkflows.io/
MIT License
6.26k stars 1.15k forks source link

Elsa 3.0 DropIns Features does not appear to work #4797

Closed markjones-WK closed 1 month ago

markjones-WK commented 8 months ago

I cannot seem to get the DropIn feature workring with Elsa 3 (3.0.2 and 3.0.3). I am using the 'Elsa.Server.Web' project from the main branch since it has the drop-in feature enabled in program.cs.. I am running this from visual studio (not the docker image, 'elsaworkflows/elsa-server-v3:latest') The App_Data/DropIns folder is created; however, when I drop a .dll that has a custom activity in it; I cannot see it in the designer. I had this working back in November/Decmber timeframe before elsa 3 was released. I have also tried to copy the .dll from the 'samples\drop-ins\SampleDropIn' sample project and it still does not work.
I have treid from both teh docker hub images and the Elsa.Server.Web project.

markjones-WK commented 8 months ago

FYI, when copying the 'SampleDropIn.dll' from the sample dropin project, the code fails in this file:

\common\Elsa.DropIns\HostedServices\DropInDirectoryMonitorHostedService.cs

in the LoadDropInAssemblyAsync() method on this line:

var dropInDescriptors = directoryCatalog.List();

Hopefully this helps debug this quicker and we can find a fix prior to 3.1.

Thanks, MJ

markjones-WK commented 8 months ago

nudge :)

sfmskywalker commented 8 months ago

Hey there, not to worry, I haven't forgotten about this one :)

RenatoCapelo commented 1 month ago

@sfmskywalker I've stumbled across this issue as well. I went in and cloned the repo and think I found the fix. (Will create a PR later) One thing I saw is that there is no way to "unload" dlls / nugets while running the instance due to the files being locked. I'm thinking of changing the way they are added to prevent the locks and adding a Unload method on the IDropIn interface. What do you think?