CPackage::LoadFromXML fails while loading a dtsx from C# -
10-26-2006
, 11:04 AM
Hello,
I use this code to load a dtsx from my C# code :
public static FileStream[] LaunchSSISFileMode(string pckgPath,
string pckgConfigPath, Dictionary<string, Object> variables, out DateTime
endedAt, out List<string> errors, out Boolean lastStatus)
{
try
{
Microsoft.SqlServer.Dts.Runtime.Application app = new
Microsoft.SqlServer.Dts.Runtime.Application();
Package package = app.LoadPackage(pckgPath, null);
package.ImportConfigurationFile(pckgConfigPath);
Variables vars = package.Variables;
foreach(string sKey in variables.Keys)
{
vars[sKey].Value = variables[sKey];
}
DTSExecResult result = package.Execute();
errors = new List<string>();
foreach (DtsError err in package.Errors)
{
errors.Add(err.Description);
}
lastStatus = (package.Errors.Count == 0);
endedAt = package.StopTime;
return null;
}
catch (DtsException dtsExc)
{
errors = new List<string>();
errors.Add(dtsExc.Message);
lastStatus = false;
endedAt = DateTime.Now;
return null;
}
A UI calls through remoting this piece of code.
It works well on my computer with SQL Server 2005 installed and both the UI
and server component, but it doesn't if I use a distant server component with
the same configuration.
The error is :
"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."
The package is present on the server at the right place (if I specify a
wrong path the error is different, I tried).
Thanks for help
Best regards.
Romain |