问题
I'm loading a ssis package from my application which works fine. However, what I'm trying to work out and failing miserably is that the package executes in 1 second (which is great) but the loading of the package takes 9 seconds.
Working locally in visual studio 2015 connecting remotely to a SQL Server 2014 instance.
The package is being loaded in a business object behind an async web api call from a console application.
Heres the code (standard stuff)...
Application application = new Application();
DTSExecResult result;
DTSPackageEventListener eventListener = new DTSPackageEventListener();
packageLocation = request.packageLocation;
//using (Package package = application.LoadPackage(packageLocation, eventListener)) // 9 seconds to load
using (Package package = application.LoadFromDtsServer(@"File System\<PACKAGENAME>", @"<SERVERNAME>", eventListener)) // 9 seconds to load
{
.
.
.
Does anyone have any tips? Any help/guidance would be much appreciated.
Simon.
回答1:
This is normal, dtsx file is an xml file and the DtsRuntime library need to deserialize the file to load it as dot net class. Also there are some validation that are done on package loading.
来源:https://stackoverflow.com/questions/44371075/loading-ssis-package-programmatically-in-c-sharp