Recent versions of SAS Enterprise Guide (version 5.1 and later) use Microsoft .NET 4.0, which enforces additional security requirements before running custom task DLLs that you download from the Web, including those that you download from support.sas.com. Because these task DLLs are downloaded from the (big and scary) Internet, the Microsoft .NET runtime does not automatically "trust" them as it would trust a properly installed application. To enable the task to run, you must first "unblock" the file using Windows Explorer.
- Using Windows Explorer, browse to the assembly (DLL) that you downloaded from the samples and extracted from the Zip file.
- Right-click on the DLL file, and from the shortcut menu, select Properties.
The Properties dialog box opens. - On the General tab, click Unblock to indicate that this DLL is trusted
(Note: the Unblock button will not appear if the assembly is already unblocked and available.) - Click OK to close the Properties dialog box.
If the DLL is blocked when you try to add it in SAS Enterprise Guide, you might see a message such as the following, and the task will not appear in the Tools->Add-Ins menu:
Unable to load program .... Could not load file or assembly 'SAS.Tasks.Examples' or one of its dependencies Operation is not supported. (Exception form HRESULT: 0x80131515)
You can read more about this security feature and behavior in this Microsoft Knowledge Base article. If you build your own custom tasks (for example, by using the example projects and source code), you will not need to unblock the DLLs as you build them.
UPDATE from 03Jun2013: An alert reader (see the comments) found two additional useful hints:
- There is a Microsoft tool named streams.exe that you can use to automate this "unblock" operation for a set of files or entire folders.
- Even with these tools, you might require elevated privileges on your machine to modify a DLL file to "unblock" it. If all else fails, check with your local IT team to see if they can help with it.
Related articles
Custom tasks for SAS Enterprise Guide: Q & A
Introduction to SAS Custom Tasks [SAS Talks webinar]
Custom Tasks for SAS Enterprise Guide using Microsoft .NET
15 Comments
Thanks Chris, I attempted to install a couple of your custom tasks and got the 'Unable to load file...(Exception from HRESULT: 0x80131515)' error, but when I try to unblock the DLLs as you suggest the Unblock button is not visible. I suspect there may be an issue with .NET configuration lurking in the background here, is there anything else I could try? Enterprise Guide version is 5.1 and OS is Windows 7 Professional SP 1.
Geoff, that's definitely the symptom you get with the "Unblock" issue. Another possible cause is putting the DLL on a network drive (such as a mapped drive or UNC path) and trying to load it from there. That latter scenario can be fixed by either 1) putting on a local machine drive or 2) changing your .NET 2.0 Runtime config and adjust the Code-Access Security so that the path is listed as "Trusted".
Thanks for your help Chris. I've still not been able to unblock the dll either by changing the .NET 2.0 config or by using the SysInternals streams.exe to remove the stream marking it as from the Internet Zone (it was already on a local machine drive). I will try getting our tech support team to look into it.
Geoff,
I've never seen this issue get so sticky. Another thing to check: ensure that you don't have another copy of the DLLs in a path that Enterprise Guide might search (for example, a ./Custom folder within your EG install directory or %appdata%\SAS\EnterpriseGuide\5.1 folder). A rogue copy of an "unblocked" DLL might obscure the copy you are trying to load.
Thanks again Chris. It turns out our tech team had removed, among other things, the power to unblock dlls from my profile. I managed to find a friendly admin to go in and unblock it for me, after I solemnly swore it was trustworthy of course :) Now the add-in is installed and functioning nicely.
So nothing too out of the ordinary going wrong, just a slightly paranoid corporate IT security setup. Thanks for your help and for creating these add-ins, the macro variable/options viewer in particular I find a very useful addition to my EG workspace.
Geoff - I'm glad that you got to the bottom of it, and it works now! I may update the post to reflect this possible obstacle.
Pingback: Process Interruptus: a custom task to pause your process flow - The SAS Dummy
Pingback: Project Reviewer task and Copy Files task: refreshed for v7.1 - The SAS Dummy
Pingback: There and back again: copying files in SAS Enterprise Guide
SysInternals to the rescue again! I was able to overcome this issue also by using streams.exe from SysInternals.
C:\Program Files (x86)\SAS\Add-InForMicrosoftOffice\7.1\Custom>streams.exe -d SA
S.Tasks.Examples.SimpleCodeEditor.dll
Streams v1.56 - Enumerate alternate NTFS data streams
Copyright (C) 1999-2007 Mark Russinovich
Sysinternals - http://www.sysinternals.com
C:\Program Files (x86)\SAS\Add-InForMicrosoftOffice\7.1\Custom\SAS.Tasks.Example
s.SimpleCodeEditor.dll:
Deleted :Zone.Identifier:$DATA
Pingback: New and improved: Importing SPSS data files in SAS Enterprise Guide - The SAS Dummy
Pingback: Viewing SAS catalogs and formats in SAS Enterprise Guide - The SAS Dummy
I guess the Excel export task does not work with Enterprise guide 7.1 ?
The Export to Excel 2010 custom task? No, that was discontinued since native XLSX support was added in later versions of EG. Plus, you can create XLSX-based reports directly from EG using the ODS EXCEL destination.
Pingback: How to copy files in SAS Enterprise Guide - The SAS Dummy