I was building a Zero Touch plugin as a DLL, and trying to pass this DLL, along with the other referred DLLs, from my office laptop to two colleagues’ workstations for testing purposes. If it matters, the method of passing is simply by copy-and-paste via a thumb drive; we are still in the middle of setting up our release server. When importing the DLL on their machines, I encountered the following error.
Failed to import C:\path\myplugin.dll
Exception of type ‘ProtoCore.BuildHaltException’ was thrown.
This happens on both Dynamo Revit and Autodesk Dynamo Studio.
There are some discussions about this issue: link1, link2.
The suggested solutions did not work. These include:
- Verifying that the DLL is a managed one, and it is, as it can be imported and used normally from my office laptop.
- The most frequent suggestion is to unblock the files. As there is no such option in my colleagues’ machines, I used PowerShell to do this. However, this still didn’t work too.
- I repeated the above procedure with a very simple DLL, built from a class with one static method, and it can be imported on both my colleagues’ machines without any problem.
- I tried to import the original DLL with my own personal laptop, and it worked!
Does anyone have any idea how to solve this problem please?
is your solution available? Does it build on your colleagues machine. Very possible is that a referred DLL is not present or the other dlls are being imported instead or as well as your intended node dll.
Can you try preparing a package with package.json file and sending them this package instead so you can mark which dlls are definitely node dlls.
Powershell is what I would suggest as well to unblock the dlls. Another thing to try, even easier. Simply zip the entire folder of dlls with 7zip, then use 7zip to unzip on the other machine. This will throw away the mark of the web data which windows adds.
Thank you Michael. Based on your reply, here are a few things that I further tried. I’m afraid these still didn’t work.
- Using PowerShell (again), now with the -WhatIf option. I can see messages showing the process of unblocking the files.
- Zipping and unzipping with 7zip
- Progressively deleting the files, up to the point that only the main DLL is left.
By package.json, do you mean the pkg.json as written here? My impression is that it is used for libraries written as packages (non-Zero Touch), so would this work with a Zero Touch one?
The solution is available to my colleagues, so that will be our next attempt. I will also take a look at the Dynamo installation on my own personal laptop, which I didn’t have any problem importing the DLL on.
I am revisiting this thread since we are still having a problem in importing a Zerotouch library on different machines.
To narrow down the problem, I created a library with only one DLL. It was written as one class and one method in C++/CLI (used to write our library). I tried the following two routes to distribute this DLL.
- With a simple ZIP file, by archiving this DLL using 7zip. The ZIP file was then extracted using 7zip again on the target machine.
- By creating installers; I built two installers using NSIS and SimpleInstall, to be executed on the target machines.
The ZIP file and installers can be found here.
We tested this library with a few machines and got mixed results. The DLL can be imported on some machines but failed on a few others.
Unfortunately the PowerShell method is not really favourable because we don’t really want our users to do it. However I recall that it did not work for us as well.
In addition, on the other machines I did not find an Unblock button as well.
So I am just wondering if anyone can shed a light on this problem, or share some insights how you typically distribute your Zerotouch libraries.
In terms of how packages are distributed, have a read of this thread.