Hi,
I want to use a compiled library in a solution, but not have the automation script for it in the same solution as the script I want to reference it from.
Reading Using the library in a DataMiner Automation Script Solution it says in step one to add all automation scripts that you want to use this library to this solution, which does fit well when going to a CI/CD pipeline.
Is there a way of referencing the library dll in the solution without having DIS auto add the dll path to the DLL references? I have it referenced in the script reference section.
Hi Philip,
There are probably two options:
- Create an 'automation script' and compile it as a library (as from the documentation). Then you can use this 'automation script' as a library in your other scripts. The disadvantage here is that you will have it in one solution (to prevent compilation errors). If you want to separate them, then you probably want to use the other option
- Create a dll or NuGet that contains the library that you want to reuse. You can then add this dll/NuGet as a reference in your automation script(s). If you are using a dll, place it in the Dll folder of your solution, add it into the VS solution and reference the dll into the script project. If you are using a NuGet package, then no extra configuration work is needed. Make sure to use the publish button, dmapp package or CICD pipeline to publish as just copying the code to clipboard will not copy the dll to the DataMiner agent.
How are you publishing at the moment?
If you are using the CICD action from GitHub, I can’t immediately think of how to not push the shared library that is included in the repository. You can try to use the Feedback button in DIS (Visual Studio => Extensions => DIS => Send Feedback…) to point out the limitation.
we’re currently pushing from DIS to the DMS rather than CI/CD, but don’t need to include the dll in the include folder, as it already exists on the DMS when the precompiled automation script was added; we just need to suppress the DLL reference as the script reference does what we need.
I’ll send the feedback on the limitation thanks.
We have an item on our backlog (for a while) to tackle this, I can bring it up with our PO to reprioritize.
The goal would be to give DIS built-in support to mark a NuGet or Assembly as actually being an ‘automationscript as library’ and avoid that reference getting added to the dll reference.
Initial investigations on the task found we can’t add custom properties to assemblies any more (SDK Style projects no longer allow this) so our eventual feature would likely include a custom ‘tag’ in the NuGet Description we can filter on to change behavior.
Thanks for the support on this Jan, and looking re-looking at the backlog item
Hi Michiel,
We’re using NuGet packages for most things, but have an instance where we would want to update some values in the code globally from time to time, which is why I’m thinking using the automation script library option.
Everything works as needed, but currently we’d have to put a manual step in to remove the DLL reference when uploading any script referencing the library; so I was hoping there was an option in DIS to stop it adding the DLL reference when deploying.