Hi, I'm just looking at the automation script solution in the last version of DIS, I've used the protocol equivalent for a while.
I see the AutomationScript_ClassLibrary under internal already has a reference to the Newtonsoft.Json.dll, and I can reference the same Newtonsoft.Json.dll against the script cs so it don't complain about a missing reference, but when it's uploaded it adds a dll ref of my local copy, which isn't in C:\Skyline DataMiner\ProtocolScripts\.
Is there an option coming out to add the reference so it doesn't do this (or another way), like in the protocol solution, under the edit script dropdown to the left of the Exe tag?
As a workaround I've added the dll to C:\Skyline DataMiner\ProtocolScripts\ on my local machine, and referenced it there.
Hi Philip. This is a known issue we are solving hopefully soon in DIS. In the meantime, you can manually add a DataMinerDLLPath tag to the .csproject file using the following procedure:
- In VisualStudio Solution Explorer, select the automation project and, with a right-click, unload the project:
- Once unloaded, edit the .csproject by clicking on the Edit option in the project's context menu:
- In the editor, find a reference to the Newtonsoft.Json.dll with the HintPath tag beginning with a couple of dots (..\\..) and add a new tag DataMinerDllPath with the path where the DLL should be located:
- Save the .csproject file and reload the project. From now onwards, the compiled script should reference the specified path instead of the ProtocolScripts folder.
This change is only necessary the first time a new reference is added to the project. Also, be sure not to modify any reference in the .csproject file with a HintPath beginning with "C:\Skyline DataMiner..."
Even easier. Thanks Tom!!
Thanks Tom!
There is no need to unload the C# project and edit the csproj file manually. The DataMinerDllPath property can also be set in the Visual Studio UI itself. To do so right click on a DLL reference (i.e. Newtonsoft.Json.dll) and choose ‘Properties’. In the properties window that now appears you can edit the DataMiner path of the DLL.