Hi,
I'm looking at using compiling a C# code block as a library to simplify some of our scripts, as we have several methods that are duplicated over a lot of them, everything works as explained in Compiling a CSharp code block as a library until I get to the script reference part, once uploaded the reference shows as "C:\Skyline DataMiner\ProtocolScripts\" instead of "C:\Skyline DataMiner\Scripts\Libraries\".
Manually editing the path to the correct one resolves the issue, but I don't want to have to do that every time I upload a change; I can use a ref parameter directly to it, but then that's linked directly to a specific version, which might cause issues down the line.
Also testing edits on the library I see a new version is created each time with a new date in "C:\Skyline DataMiner\Scripts\Libraries\", but then I need to update the reference in my project to use the new version, which does make sense for version compatibility, but I then end up with different version of the dll between our dev and production systems unless I copy one of the files from one to the other and replicate it.
Hi Philip,
On the properties of the reference, you can define the DLL path. When compiling the automation script it will include the defined path to the DLL References.
Thanks Gelber,
I'll put this as an answer, since I can't put screen grabs in comments.
I've added the reference in VS and put the scriptref in as highlighted in the screen capture below (ignore the manual ref, I just put that in so I had the correct ref in when I uploaded it, it acts the same with or without it)
Once uploaded to DataMiner I get the following (again ignore the unhighlighted one, as that's from the manual ref I put in), the auto generated dll reference has the wrong path of protocolscripts instead of the location where the dll is created when the compile as library with name is checked, which is script/libraries.
If I'm doing something wrong in VS please let me know.
Hi Philip,
Are you referring to the shared library project in the VS solution? (Instead of browsing the DLL file where you have that shared code):
Adding the reference will prevent errors during the compilation at VS, but you also need to set the <Param type="scriptRef"> tag in the XML of the automation using that shared library so that when the automation is loaded, DataMiner will automatically resolve a valid reference to the shared code without having to specify any path to a file.
Hi Gelber,
See my comment/answer below.
Thanks Wannes,
The DLL Path override did the trick