Loading SSIS Package Programmatically in C#

只愿长相守 提交于 2019-12-10 19:24:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!