Dynamo not opening: Dynamo.Exceptions.LibraryLoadFailedException

I was working with a custom library which was working fine just today. Now I tried to open Dynamo, and I get the exception Dynamo.Exceptions.LibraryLoadFailedException with the path to one of my custom libraries. I have had this problem before, and the way I solved it was moving the library to a different folder, after which Dynamo opened just fine, and then reloading the library from the new folder. So when I had this problem this time, I tried the same procedure, only this time it did not work, and it continues to indicate a failure even though the library it is complaining about does not even exist anymore. Does anyone have any idea what to do?

I am labelling this as a bug, because regardless of how dynamo is loading the file, I suppose it should not just lock me out of the app. The exception should be handled somehow while still allowing users to access Dynamo.

Start by restarting your CPU, recreating then issue, and posting your log file from the failing session. It would also help to outline some of what you are developing.

  • Are you in Dynamo core, or an integration? Which Dynamo version are you in?
  • Is it a dyf based package? A set of zero touch nodes? Node Model nodes? A view extension? Some combination thereof?
  • Does it utilize any external references which might be common to another tool or aspect of dynamo, such as NewtonSoft json?
  • Have you packaged it previously, or are you always loading it as a library?
  • Do you have a reference to one of Dynamo’s DLLs set to copied local?

I’m removing the ‘bug’ tag for now (not that tags here have any measurable weight on development direction - bug reports should be via the GitHub) as until we can confirm where the issue is there isn’t really a bug but more of a ‘what went wrong with your development process.’

Thank you for the response! I am including the log file after restarting the CPU at the end of this response.

Answering your questions though: my library consists of ZeroTouch nodes, written for Dynamo for Revit version 2.16. It does not utilize any tools other than ZeroTouch itself, I have never packaged it before, but I have built it on both Release and Debug versions before (at first both loaded properly).

Dynamo log started 2023-12-18 20:41:42Z
2023-12-18 20:41:43Z : Python template set to default.
2023-12-18 20:41:44Z : launch darkly initalized
2023-12-18 20:41:44Z : LD startup time: 1295
2023-12-18 20:41:44Z : <<<<>>>>
2023-12-18 20:41:44Z : feature flag exe starting
2023-12-18 20:41:44Z : <<<<>>>>
2023-12-18 20:41:44Z : {“graphics-primitive-instancing”:false,“testFlag”:false,“EasterEggIcon1”:false,“EasterEggMessage1”:“NA”,“CER”:false,“NodeAutocompleteMachineLearningIsBeta”:true,“CER_v2”:true}
2023-12-18 20:41:44Z : <<<<>>>>
2023-12-18 20:41:44Z : EasterEggIcon1 is false FROM MODEL
2023-12-18 20:41:44Z : EasterEggMessage1 is disabled FROM MODEL
2023-12-18 20:41:49Z : Dynamo – Build 2.16.1.2727
2023-12-18 20:41:49Z : System.InvalidOperationException:
2023-12-18 20:41:49Z : There already exists an AlsoKnownAs mapping for DSCoreNodesUI.Logic.If.
2023-12-18 20:41:49Z :
2023-12-18 20:41:49Z : System.InvalidOperationException:
2023-12-18 20:41:49Z : There already exists an AlsoKnownAs mapping for If.
2023-12-18 20:41:49Z :
2023-12-18 20:41:49Z : Duplicate migration type registered for SunPathDirection
2023-12-18 20:41:52Z : AnalyticalAutomation.dll,M:AnalyticalAutomation.AnalyticalElements.AnalyticalPanel.BySurface(Autodesk.DesignScript.Geometry.Surface,System.Boolean) {0} is missing some XML documentation tags.
2023-12-18 20:41:52Z : The folder ‘C:\Program Files\Autodesk\Revit 2023\AddIns\DynamoForRevit\Built-In Packages\Packages’ does not exist
2023-12-18 20:41:52Z : Failed to load library: C:\Users\MyName\OneDrive - Company\Documents\DynamoCustomNodes\L1\bin\Debug\L1.dll
2023-12-18 20:41:52Z : notification:Dynamo.Exceptions.LibraryLoadFailedException: Failed to load library: C:\Users\MyName\OneDrive -Company\Documents]DynamoCustomNodes\L1\bin\Debug\L1.dll:
Failed to load library: C:\Users\MyName\OneDrive - Company\Documents\DynamoCustomNodes\L1\bin\Debug\L1.dll:
Library C:\Users\MyName\OneDrive - Company\Documents\DynamoCustomNodes\L1\bin\Debug\L1.dll has been loaded.
2023-12-18 20:41:52Z : Dynamo.Exceptions.LibraryLoadFailedException:
2023-12-18 20:41:52Z : Failed to load library: C:\Users\MyName\OneDrive - Company\Documents\DynamoCustomNodes\L1\bin\Debug\L1.dll
2023-12-18 20:41:52Z :
2023-12-18 20:46:21Z : EasterEggIcon1 is false FROM MODEL
2023-12-18 20:46:21Z : EasterEggMessage1 is disabled FROM MODEL

Is this edited text? If so, can you post the file itself? Some of the paths look off…

Also can you post your Dynamo setting a file? Looks like the instance is trying to load the same directory repeatedly which can cause issues with conflicts.

Also can you check the list of references you have in your IDE to be sure nothing is set to copy local which shouldn’t? You may have to clear your build path manually as sometimes removing the copy local will keep the copied files.

Hello, thank you again for your response.

I have edited the path for privacy reasons, by replacing my company name with “Company.” That’s all I changed, as I can’t post the actual location of these files.

This website does not allow me to link .xml files, so I am sending DynamoSettings as a txt file instead.
(upload://jWFPO2CbvRlzTS2JSk6w5bVFzr1.txt) (5.8 KB)

I checked the references on VisualStudio and three of them were set to copy local: DynamoServices, DynamoUnits and ProtoGeometry. I have set them to copy local false and cleared the path. But I do still get the same error. Is there anything else I should do with these files?

So the directory you are building to is empty at this time?

Do you mean the bin directory within the project? If so, yes

Meaning the directory if you open it in file browser (not in visual studio).

By the looks of it you have referred to the same path 2x, and the same DLL 3x in your settings file.

<CustomPackageFolders>
<string>%BuiltInPackages%</string>
<string>C:\Users\BrunoTeruel\AppData\Roaming\Dynamo\Dynamo Revit\2.16</string>
<string>C:\ProgramData\Autodesk\RVT 2023\Dynamo\2.16\packages</string>
<string>C:\Users\BrunoTeruel\companyName\Processos - Documents\Biblioteca\Revit\05_Rotinas Dynamo\NĂłdulos Customizados</string>
<string>C:\Users\BrunoTeruel\companyName\Processos - Documents\Biblioteca\Revit\05_Rotinas Dynamo\Nódulos Customizados\Zien - Panelização.dll</string>
<string>C:\Users\BrunoTeruel\OneDrive - companyName\Documents\Codigos\DynamoCustomNodes\Zien - Panelização\bin\Debug\Zien - Panelização.dll</string>
</CustomPackageFolders>

Open the settings file in notepad, remove lines 51 to 53 of the settings file, save the file and close it, then relaunch and see if it has any problems. If Dynamo works, close it, go to each of the paths in the removed lines, and archive the directories to a backup location.

Then build your package once more, check if the build processes, and work from there.

From what I can tell Dynamo is trying to do what you asked, but one (all?) of the 3x attempts to load the copied DynamoServices, Dynamo Units, and ProtoGeometry libraries instead of utilizing the one which Dynamo already loaded, which is causing a dependency conflict and thereby referencing errors which is causing issues with pretty much anything.

If that doesn’t resolve it, go to C:\ProgramData\Autodesk\RVT 2023\Dynamo\2.16\packages and make sure only Generative Design is in the directory. Then go go C:\Users\BrunoTeruel\AppData\Roaming\Dynamo\Dynamo Revit\2.16\packages and rename that directory (append an _ to the end). You should then have no customizations at all. Restart everything and see if that resolve the issue. If so, you can move over 1/2 of your packages to the new directory between restarts until you identify the combination of packages which recreates the issue.

1 Like

Thank you very much!!! Erasing those lines from DynamoSettings, clearing the directories and rebuilding as you suggested solved the issue!

1 Like

Glad you are sorted out!

The take aways as I see them to prevent issues in the future are as follows:

  • When developing, set up an environment with only one package path, and build to that. Once ready to package, rename the packages directory and use the now unreferenced directory to build the deployed package on package manager or in your local environment.

    • I have an automation routine to configure my environment for each custom tool, customer engagement, and my personal playground. It basically renamed the Dynamo/2.XX/packages folder to the environment name and the sets the environment name to the packages directory. If you get to the point of needing more than 2 directories I recommend building your own version of this.
  • When adding references, if the reference already exists in either the Dynamo or Revit environment and it is an ‘in process’ reference, make sure it isn’t set to copy local. When required (I.e. Robot’s COM api) always attempt without first.

  • If references get copied accidentally, nuke the build directory contents before building again.

1 Like