Question

I have an SSIS package where I reference Interop.ActiveDs. Within the script editor the type I'm using is recognized and the script builds and saves just fine. When you execute the package it throws the exception

Could not load file or assembly 'Interop.ActiveDs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

When you're in the script editor all of the properties are pointing to a temporary directory. No doubt, when you save and exit the script the temp directory is abandoned. When the script is executed a copy is placed on the file system?. Possibly it does not copy or persist dependent dlls?.

Is it possible to resolve this problem with SSIS?

So far what I'm getting is ActiveDs is COM and SSIS won't do COM? Need to get it registered in GAC?

Was it helpful?

Solution

So there are two issues here when trying to make this work in SSIS

if (result.Properties["uSNChanged"] != null && result.Properties["uSNChanged"].Count > 0)
{
    var _uSNChanged = (IADsLargeInteger)result.Properties["uSNChanged"][0];
    Output0Buffer.uSNChanged = (_uSNChanged.HighPart << 32) + _uSNChanged.LowPart;
}

First IADsLargeInteger is a COM object. In order to use it you'd need to create an Interop dll and register it in the GAC. This, I believe, is addressed by this post. I haven't tried this since...

Second though, it seems all of this can be avoided if everything is typed correctly to begin with. So in stead of messing around with COM Interop just to do an unnecessary translation, I believe this is the better solution to the issue.

if (result.Properties["uSNChanged"] != null && result.Properties["uSNChanged"].Count > 0)
{
    Output0Buffer.uSNChanged  = (Int64)result.Properties["uSNChanged"][0];
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top