Hi there!
Working on a Dynamo package implemented through NodeModels. The package itself is a quite thin wrapper around a core DLL, which handles all the heavy load.
Before, the package was developed with all Zero Touch nodes, so just having the core depedency DLL in the package’s bin
folder was enough to have it picked up by the package.
On migrating the Nodes to NodeModels, this doesn’t work unless I load the assembly as a node_library
, but I am having issues correctly loading the assembly.
My current pkg.json
looks like this
{
"contains_binaries": true,
"contents": "",
"dependencies": [],
"description": "A Dynamo plugin for Robot programming and control. https://github.com/garciadelcastillo/Machina",
"engine": "dynamo",
"engine_metadata": "",
"engine_version": "1.3.0.862",
"file_hash": null,
"group": "",
"keywords": [
"robot",
"programming",
"control",
"machina",
"brobot"
],
"license": "",
"name": "Machina",
"node_libraries": [
"Machina, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
"MachinaDynamo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
],
"repository_url": "https://github.com/garciadelcastillo/Machina",
"site_url": "",
"version": "0.4.3"
}
This works fine, but the core DDL Machina
shows up on Dynamo’s library, i.e. it is taken as a Zero Touch library.
However, if I declare instead as a dependency:
{
"contains_binaries": true,
"contents": "",
"dependencies": [
"Machina, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","Machina, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
],
"description": "A Dynamo plugin for Robot programming and control. https://github.com/garciadelcastillo/Machina",
"engine": "dynamo",
"engine_metadata": "",
"engine_version": "1.3.0.862",
"file_hash": null,
"group": "",
"keywords": [
"robot",
"programming",
"control",
"machina",
"brobot"
],
"license": "",
"name": "Machina",
"node_libraries": [
"MachinaDynamo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
],
"repository_url": "https://github.com/garciadelcastillo/Machina",
"site_url": "",
"version": "0.4.3"
}
I get this error on Dynamo’s console:
Failed to form package from json header.
Newtonsoft.Json.JsonSerializationException: Error converting value "Machina, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" to type 'Greg.Requests.PackageDependency'. Path 'dependencies[0]', line 5, position 72.
Exception encountered scanning the package directory at D:\Dropbox\Jose Luis\code\MachinaDynamo\package\Machina
System.Exception:
D:\Dropbox\Jose Luis\code\MachinaDynamo\package\Machina\pkg.json contains a package with a malformed header. Ignoring it.
at Dynamo.PackageManager.PackageLoader.ScanPackageDirectory(String directory)
So, questions:
- How can I correctly load dependencies of a package using NodeModels?
- And, how can I load an assembly as a
node_library
, and completely hide it from Dynamo’s library?
Thanks!
JL