DynamoDS / Dynamo

Open Source Graphical Programming for Design
https://dynamobim.org
Other
1.71k stars 632 forks source link

Dynamo Sandbox doesn't read Custom Nodes #8951

Closed erfajo closed 5 years ago

ramramps commented 6 years ago

Is there any notifications? I mean, can you check if there is one by clicking the green "!" on the top?

mjkkirschner commented 6 years ago

Hi @erfajo how is your package structured? Can you share an image of the package root directory? Are the custom nodes in a .dyf folder?

Do you have this issue with DynamoRevit?

Your package has both ZT and custom nodes?

mjkkirschner commented 6 years ago

It might be worth mentioning that dynamoRevit and dynamoSandbox have different package paths. A first guess is that sandbox is pointed to your dll, but does not actually have your package installed.

Can you check the manage package paths / and manage packages menu items in sandbox so see if

  1. you have installed your package in sandbox
  1. you don't have an extra package path added that points to your zero touch dll directly - it might be getting loaded twice and causing weirdness.
mjkkirschner commented 6 years ago

@erfajo I would like to try reproducing your issue in sandbox. Can you please give me the most direct steps possible to install your package that should reproduce the issue on sandbox?

mjkkirschner commented 6 years ago

Hi @erfajo I can reproduce this and I think I know whats going on - I fear you will not like the reason 😄 .

It appears your package has a dependency on the revit API. When Dynamo attempts to load your dlls it cannot as it fails to find the required dependencies, this throws an exception, at this point the first dll is loaded, the revit one fails to load, but the custom nodes never load as a result of the exception.

I found this in the dynamo console:

Exception when attempting to load package Orchid from C:\Users\kirschm\AppData\Roaming\Dynamo\Dynamo Core\2.1\packages\Orchid_200
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

When I find the full exception it states:

System.IO.FileNotFoundException: 'Could not load file or assembly 'RevitAPI, Version=18.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.'

Which makes sense.

I think there are two solutions:

  1. Dynamo still throws an exception, but not until after loading the rest of the package.
  2. You break your package into two parts, a sandbox version which only contains the core dlls, and a revit one which depends on both of your dlls.