If you encounter the following error when using SAS's StoredProcessService events:
event invocation for COM objects requires event to be attributed with DispIdAttribute
Roll your project back from .NET 4.0 to .NET 3.5. This may only be applicable to the web services code.
Example code:
class Program
{
static void Main(string[] args)
{
Workspace ws = new Workspace();
SAS.LanguageService ls = ws.LanguageService;
ls.StepError += new CILanguageEvents_StepErrorEventHandler(ls_StepError); <---- ERROR OCCURS HERE
ls.Submit("data test; abort; run;");
}
static void ls_StepError()
{
Console.WriteLine("Bingo!");
Console.ReadLine();
}
}
This blog is designed to show various ways to use Data Virtualization, technologies, and SAS with Microsoft technologies with an eye toward outside of the box thinking.
Subscribe to:
Post Comments (Atom)
SAS throwing RPC error
If you are doing code in C# and get this error when creating a LanguageService: The RPC server is unavailable. (Exception from HRESULT:...
-
I am finally ready with my SAS dataset reader/writer for .NET. It is written in 100% managed code using .NET 3.5. The dlls can be found here...
-
I was just tasked to read in LDAP records so we could cross-reference userids with login identifiers and general ledger information. Using...
-
Well, around 14 months ago, I started on a journey to understand the SAS dataset so I could read and write one independently. Originally, I ...
3 comments:
Alan, I ran this by some colleagues here. In your reference to the SAS Interop assemblies, try changing the "Embed Interop Types" property to False. By default, VS2010 and .NET 4.0 might set them to be True.
Chris,
That did it. Under .NET 4.0, the COM assemblies are marked as Embedded = true.
For people who need to fix this, after adding references to SAS, ObjectManager, IOMCommon, etc., click on the reference, look in properties, and change Embed Interop Types to False.
Awesome! Error hit, blog found, error fixed, total elapsed time under 5 minutes. Thanks, guys!
Post a Comment