Revit plugin DLLs downloaded from my GitHub don´t work. The ones compiled in my machine load fine

0

Sorry for the long title, I´ll try to be brief.

I have developed a collection of IExternalCommands for Revit 2020 using C# and Visual Studio. Also an IExternalApplication for a ribbon to contain them. They work like charm in my computer. I am using GitHub to store the project and I am testing what another person would need to do in order to install my plugins:

  • Downloading the DLLs from GitHub into my computer.
  • Copying the necessary .dlls and .addin files in one of the Revit addins folder %programdata%/Autodesk/...etc.
  • I open my Revit... my surprise is that I get the following error:

System.IO.FileLoadException

Could not load file or assembly 'file:///C:\ProgrammData\Autodesk\ApplicationPlugin...\ArpRibbon.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

But if I use the DLLs that have been compiled locally in my machine... it works! How is that possible? Does anyone know what am I doing wrong? I have been searching but can´t find anyone with a similar problem.

Many thanks in advance.

c#
visual-studio
github
revit-api
revit
asked on Stack Overflow May 8, 2020 by angelrps • edited Jun 20, 2020 by Community

2 Answers

1

As from comment:

Just a thought, but the file is loaded from internet. Maybe windows security mechanism kicks in. Can you browse to the file with explorer and right click to see it properties? There might be some security details there about disabling access due to external dll.

This indeed proved to be the case.

answered on Stack Overflow May 9, 2020 by Stefan
0

You can mark the question as answered by copying Stefan's comment into an answer and confirming that it solves the issue:

Just a thought, but the file is loaded from internet. Maybe windows security mechanism kicks in. Can you browse to the file with explorer and right click to see it properties? There might be some security details there about disabling access due to external dll. – Stefan 17 hours ago

Thank you both for your quick responses. The issue was exactly what @Stefan suggested. There was a security message in the properties file saying: "This file came from another computer and might be blocked to help protect this computer." And then an *Unblock" checkbox. I unblocked the dll and it worked. In my case I was downloading the files with google Chrome. Many thanks again! How can I mark the question as answered? – angelrps 4 hours ago

answered on Stack Overflow May 9, 2020 by Jeremy Tammik

User contributions licensed under CC BY-SA 3.0