Calling SSIS Package from .Net

I am calling SSIS package from .NET UI. And SSIS and .Net application was created in 2008. The SSIS package is stored on the file system. When I started the .Net application I got the error:

Failed to load package due to error 0xC0011008 "Error loading XML. No additional detailed error for this can be specified problem information because the Events object was not passed where detailed error information can be stored." occurs when CPackage :: LoadFromXML fails.

Exception Details -

Microsoft.SqlServer.Dts.Runtime.DtsRuntimeException was unhandled
  HelpLink="#-1073659847"
  Message="The package failed to load due to error 0xC0011008 \"Error loading from XML. No further detailed error information can be specified for this problem because no Events object was passed where detailed error information can be stored.\". This occurs when CPackage::LoadFromXML fails.\r\n"
  Source=""
  ErrorCode=-1073672184
  StackTrace:
       at Microsoft.SqlServer.Dts.Runtime.Application.LoadPackage(String fileName, IDTSEvents events, Boolean loadNeutral)
       at SSISCall.Form1.Execute_Click(Object sender, EventArgs e) in D:\SSISCall\SSISCall\Form1.cs:line 36
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at SSISCall.Program.Main() in D:\SSISCall\SSISCall\Program.cs:line 17
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.Runtime.InteropServices.COMException
       HelpLink="#-1073659847"
       Message="The package failed to load due to error 0xC0011008 \"Error loading from XML. No further detailed error information can be specified for this problem because no Events object was passed where detailed error information can be stored.\". This occurs when CPackage::LoadFromXML fails.\r\n"
       Source=""
       ErrorCode=-1073672184
       StackTrace:
            at Microsoft.SqlServer.Dts.Runtime.Wrapper.ApplicationClass.LoadPackage(String FileName, Boolean loadNeutral, IDTSEvents90 pEvents)
            at Microsoft.SqlServer.Dts.Runtime.Application.LoadPackage(String fileName, IDTSEvents events, Boolean loadNeutral)
       InnerException: 

      

The code I'm using is very simple:

string packageLocation;
Package ssisPackage;
Microsoft.SqlServer.Dts.Runtime.
Application ssisApplication;
DTSExecResult ssisPackageResult;
packageLocation =@"D:\SSISCall\Package.dtsx";
ssisApplication =new Microsoft.SqlServer.Dts.Runtime.Application();
ssisPackage = ssisApplication.LoadPackage(packageLocation,null); ----Getting error here
ssisPackageResult = ssisPackage.Execute();
Console.WriteLine(ssisPackageResult.ToString());
Console.ReadKey(); 

      

Please suggest.

+2


source to share


2 answers


Do you have SSIS components installed on the computer where you are running this package? If not, it won't work - see http://msdn.microsoft.com/en-us/library/ms403348.aspx

Is the version of SSIS installed on the computer 2008? If not, it won't work - the 2005 and 2008 parts are not interchangeable.



Is drive "D" a mapped drive? If so, your code probably won't run unattended (with an unauthorized user session). Use UNC paths instead.

+3


source


Getting exactly the same error when calling Lame loadPackage.

This code works fine for SQL 2005.



EnvDTE90 is not like adding any functionality to the DTS application model.

The reference to EnvDTE80 and EnvDTE90 makes no distinction

+1


source







All Articles