I am able to execute some SSIS packages from my local computer however when I am trying to execute the same through windows service on Windows server R2 it fails. Windows Service Code:
using DTS = Microsoft.SqlServer.Dts.Runtime;
DTS.Package pkg;
DTS.Application app;
DTS.DTSExecResult pkgResults;
app = new DTS.Application();
pkg = app.LoadPackage(pkgLocation, null);
pkgResults = pkg.Execute();
I am installing the service on the server and when started it fails on app = new DTS.Application();
On the server I have already SSIS installed and I am also able to execute the Package from command prompt. The complete error message is :
Microsoft.SqlServer.Dts.Runtime.DtsComException:
An Integration Services class cannot be found. Make sure that Integration Services is correctly installed on the computer that is running the application. Also, make sure that the 64-bit version of Integration Services is installed if you are running a 64-bit application. --->
System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {BA785E28-3D7B-47AE-A4F9-4784F61B598A} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
at Microsoft.SqlServer.Dts.Runtime.Application..ctor() --- End of inner exception stack trace --- at Microsoft.SqlServer.Dts.Runtime.Application..ctor()
Any help on this?