Hi Russell and all,
Sorry if this is documented somewhere, but is it possible to load my own .dlls into Deadline?
I’ve built a small DLL to access a Windows API that’s not part of .NET, and it loads and runs fine under ipy.exe. However, when I try to run it with ExecuteScript, I get the attached error dialog. I tried signing my assembly with a “strong name key file” but that didn’t change anything.
Note from the output that even under deadlinecommand ExecuteScript, I can load the dll and extract the class from it; it’s only when I try to call into the class that the error panel is invoked.
After trying what’s documented here, I also tried placing the DLL in a directory that’s already on the Python include path defined in the repository, and then not doing the sys.path.append; it didn’t make any difference.
If it makes any difference I’m under Deadline 4.x, Windows XP64, and compiled the DLL for .NET Framework 2.0.
Leo
Test Script
[code]import Deadline.Scripting
from Deadline.Scripting import *
from Deadline.Scripting.ScriptUtils import LogText
import os
import os.path
import sys
def main(*args):
LogText(“Entry; arguments are %s”%(’ '.join(args)))
if len(args) != 2:
LogText(“No good! Must get exactly two arguments, src and dst”)
return
import clr
LogText(“clr imported”)
sys.path.append(r"H:\directoryWithDllInIt")
LogText(“Directory appended to path”)
clr.AddReferenceToFile(“DotNetHelper.dll”)
LogText(“clr AddReference called”)
import DotNetHelper
LogText(“Assembly imported via python import”)
from DotNetHelper import MyClass
LogText(“Class name imported”)
LogText(“Trying to call with %s , dst %s”%(args[0],args[1]))
result = MyClass.Create(args[0],args[1])
LogText(“Called MyClass.Create, result was %r”%result)
[/code]
DOS Shell Session
C:\svn\leo.hourvitz\trunk>"c:\Program Files\Prime Focus\Deadline\bin\deadlinecommand.exe" ExecuteScript H:\leo.hourvitz\LocalDeadlineRepository\scripts\General\TestDotNetHelper.py c:\tmp\test.mov c:\tmp\test2.mov
Entry; arguments are c:\tmp\test.mov c:\tmp\test2.mov
clr imported
clr AddReference called
Assembly imported via python import
Class name imported
Trying to call with c:\tmp\test.mov , dst c:\tmp\hardLinkToTest2.mov
---Security dialog appears here ----
c:\svn\leo.hourvitz\trunk >