Referencing a custom dll

Andrew (22 posts)
October 21, 2013 09:21 AM
Accepted Answer

I'm not able to find much documentation on referencing a dll and using it in a script. I wrote a library that encapsulates some logic to connect to a vendor's FTP and exposes some common methods.

 I would like to reference this class in a shared script like this:

FtpConnector ftp = new FtpConnector();
if (ftp.CheckForFile(filename)) {
etc.....

Here are the steps I've taken.

  1. Stored the DLL in a folder on the Master machine
  2. In the adTempus Script interface, under Referenced Assemblies, I click Add->Browse and choose the DLL. When selected, it appears in the Reference Assemblies section below the adTempus DLLs.
  3. Click OK to save the script and get this error: Script compilation error: Metadata file 'C:\adtempus\Libraries\PointFtpInterface.dll' could not be found

 I can't find anything specific to this error message in the adTempus documentation. I've used this library elsewhere without issue.

 Any help would be appreciated. Thank you.

Andy

 

Bill Staff (599 posts)
October 21, 2013 09:55 AM
Accepted Answer

Are you using adTempus 3.x?

Are you running the Console on the same computer as the adTempus service? If not, that's probably the cause of the error: in adTempus 3, when you save the script adTempus validates it by compiling it, but this is done by the Console on the computer where it is running. So if the assembly isn't on the computer where the Console is running, it will fail. Try running the Console on the adTempus server and save validate the script from there.

If you are already running the Console on the same computer as the adTempus service, try moving the assembly as discussed below:

You may run into a different problem at job execution time: the adTempus script host process may not be able to load your referenced assembly unless you add it to the GAC or put it in the adTempus program directory (or a subdirectory of the adTempus program directory). So if you get an assembly reference error when executing the script, try moving it to one of those places.

By the way, you might want to take a look at the adTempus 4 beta if you haven't already. There's a new File Transfer task that supports FTP upload/download, and the File Trigger now supports FTP as well.

Andrew (22 posts)
October 21, 2013 01:30 PM
Accepted Answer

Thanks for the help. I had to add the library to the GAC in order for it to work.

 I've done some reading on adTempus 4. We're going to wait to upgrade until it's fully released.

I'm using this library because our files are datestamped and I need to build the file name using a control date pulled from our ETL database.

 

Thanks.

Replies are disabled for this topic.