Executing SSIS Package from .NET

Hi again

First I explain my environment:
- SSIS Packages are stored on 64bit Server (Win 2003 64bit, SQL 2005 64bit)
- .NET (C#) application (on Win 2003 32bit Server) which loads and executes the SSIS Packages.

I can execute my SSIS Package localy on the 64bit Server and they work fine.
When I execute the SSIS Package from the Application I get following exeption:
Retrieving the COM class factory for component with CLSID {697AC67E-FDD5-46D1-90D7-F3D0DF1B2A47} failed due to the following error: 80040154. ...
at Microsoft.SqlServer.Dts.Runtime.Package..ctor()

The code looks like:
Microsoft.SqlServer.Dts.Runtime.Package local_Package = new Microsoft.SqlServer.Dts.Runtime.Package();
Microsoft.SqlServer.Dts.Runtime.
DTSExecResult local_DTSExecResult = new Microsoft.SqlServer.Dts.Runtime.DTSExecResult();
Microsoft.SqlServer.Dts.Runtime.
Application local_Application = new Microsoft.SqlServer.Dts.Runtime.Application();

local_Package = local_Application.LoadFromDtsServer("PackageName", "64bitServer", null);
local_DTSExe
cResult = local_Package.Execute();

Other question would be: how can I execute a package directly on the server
I mean without "LoadPackage" I guess the problem on top is because on the
32bit Server there is only Framework installed but not Integration Services Tools ...


Would be happy for any comment!

Best regards
Frank Uray



Answer this question

Executing SSIS Package from .NET

  • Winthrop Chan

    You probably only installed SQL Server Tools (which installs 32-bit SSIS runtime), but have not installed SSIS (which installs service and 64-bit SSIS runtime).

    > how can I execute a package directly on the server
    We usually recommend SQL Agent - create an Agent Job that runs the package, without any scheduler. When you need to run it, use Agent stored procedures to execute the package remotely.

    Also, please note that when you load package and run it, it runs locally on the machine where your code runs, regardless of where the package was loaded from (local or remote).



  • Sergey Bogdanov

    I got the following info from http://blogs.msdn.com/karthick/archive/2006/02/28/540780.aspx

    Failed --Retrieving the COM class factory for component with CLSID ....

    PROBLEM:

    When you run the .net Code in X64 Environment you will get the following error message.

    " Failed --Retrieving the COM class factory for component with CLSID ...."

    E.g. in CMS Export / Import server side .net code = "ExportSiteContentIncremental(...) Failed --Retrieving the COM class factory for component with CLSID {CA0752B3-021C-4F99-82E3-2C0F19C5E953} failed due to the following error: 80040154."

    WORKAROUND:

    The possible workaround is modify your project's platform from 'Any CPU' to 'X86' (in Project's Properties, Build/Platform's Target)

    ROOTCAUSE

    The VSS Interop is a managed assembly using 32-bit Framework and the dll contains a 32-bit COM object. If you run this COM dll in 64 bit environment, you will get the error message.

    Hope this helps...

    Thanks,
    Loonysan


  • Clay Budin

    Can you create a package (leveraging the API) and not run it without having SSIS installed on the client machine

  • Ben - ECM

    Ya I am interested to know if I could use the API without having to install SSIS

    If yes, what DLLs I've to copy across



  • Executing SSIS Package from .NET