2009-10-26 67 views
2

我從.net Windows用戶界面調用SSIS包。 SSIS &.Net應用程序在2008年創建。SSIS包存儲在文件系統中。當我運行.net應用程序中我得到了錯誤:從.Net調用SSIS包

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.

異常詳細信息 -

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: 

,我使用非常簡單的代碼:

string packageLocation; 
Package ssisPackage; 
Microsoft.SqlServer.Dts.Runtime. 
Application ssisApplication; 
DTSExecResult ssisPackageResult; 
packageLocation [email protected]"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(); 

請建議。

+0

請問,當你在命令行中執行該程序包,換句話說,你的.NET應用程序以外的問題出現的任何差異性?此外,該軟件包是否嘗試加載任何文件或任何其他軟件包? – 2009-10-27 16:48:20

回答

3

您是否在執行此軟件包的計算機上安裝了SSIS組件?如果不是,它將不會運行 - 請參閱http://msdn.microsoft.com/en-us/library/ms403348.aspx

是否在計算機2008上安裝了SSIS的版本?如果不是,它將不會運行 - 2005年和2008年的零件不可互換。

驅動器「D」映射驅動器?如果是這樣,您的代碼可能不會無人值守(使用未登錄的用戶會話) - 請改用UNC路徑。

1

在Lame loadPackage調用中獲取完全相同的錯誤。

此代碼是用於SQL 2005

EnvDTE90並不像添加任何功能的DTS應用模型做工精細。

引用既EnvDTE80和EnvDTE90不作