mardi 31 mars 2015

Running SSIS Package from WinForms app - Gnarly Error

I have a winforms application that makes use of Microsoft.SqlServer.ManagedDTS to load and execute an SSIS package. When running locally in debug and when installed the package runs fine, when installed on a dev server the package runs fine. When deployed onto a live server I get the following error.


Error Message


I'm running out of ideas of what to check, I don't want to move away from using this method of executing my package as this adds further complication to the application that we really don't want to introduce. Any thoughts?


For clarity I have checked:



  • SSIS is installed and is the same version (Windows/SQL Server 2008)


  • I added the following app.config key following some google searching useLegacyV2RuntimeActivationPolicy="true"




  • Tried compiling as a 32-bit and 64-bit application




  • Ensured that the DLL is registered in the GAC on the target machine




  • All permissions are the same across the two boxes




The extract of source code that is throwing the error is as follows:



var app = new Microsoft.SqlServer.Dts.Runtime.Application();
var pkg = app.LoadPackage(strSSISPath, null);
pkg.ImportConfigurationFile(strSSISConfig);

var result = pkg.Execute();

if (result.Equals(DTSExecResult.Success))
{
string strMsg = strMHType + " extract completed successfully.";
MessageBox.Show(strMsg, strMHType, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
foreach (var err in pkgMHMDS.Errors)
{
MessageBox.Show(err.Description, strMHType, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
MessageBox.Show(strMHType + @" extract failed!", strMHType, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
pkgMHMDS.Dispose();

Aucun commentaire:

Enregistrer un commentaire