【发布时间】:2016-06-09 13:03:12
【问题描述】:
SSIS 包在 VS 2013 中执行良好,但是当我尝试从 VS 2015 调用 .dtsx 时,出现此错误:
“要在 SQL Server 数据工具之外运行 SSIS 包,您必须安装 Integration Services 或更高版本的脚本任务。”
这是我在 VS 2015 中的代码:
我的 using 语句...
using System.Windows.Forms;
using Microsoft.SqlServer.Dts.Runtime;
我的代码...
private void button1_Click(object sender, EventArgs e)
{
private string pkSSIS = @"C:\Work\Pathname_Ect";
string error = "";
label1.Text = "The package is executing...";
Package pkg = null;
Microsoft.SqlServer.Dts.Runtime.Application app;
DTSExecResult result;
try
{
app = new Microsoft.SqlServer.Dts.Runtime.Application();
pkg = app.LoadPackage(pkSSIS, null);
result = pkg.Execute();
if (result == Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure)
{
foreach (Microsoft.SqlServer.Dts.Runtime.DtsError dt_error in pkg.Errors)
{
error += dt_error.Description.ToString();
}
label1.Text = "Error Not Exception: " + error;
}
if (result == Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success)
{
label1.Text = "The package executed successfully";
}
}
catch (Exception ex)
{
label1.Text = "Exception: " + ex.Message;
}
}
配置文件...
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
我正在关注一个教程 (https://technologyinsightscoffee.wordpress.com/2015/10/25/how-to-call-a-ssis-package-from-net-application/),我发现了一些与此错误相关的帖子,但没有任何东西可以帮助我解决它。知道我做错了什么吗?
【问题讨论】:
-
我不太明白你的意图是什么。你想在 VS 2015 中开发 SSIS 包吗?
-
@Johannes 我正在尝试从最近开发的 VS 2015 表单中执行旧的 2013 SSIS 包。我希望避免重写旧的 SSIS 包以节省时间,但它开始看起来比它的价值更麻烦。
-
好吧,我不知道,你为什么要那样做。 VS 2013 是当前的 SSIS-/SSDT-IDE。 VS 2015 afaik 没有稳定的 SSDT。顺便说一句:您收到的错误消息告诉您没有安装 SSDT。并且不要忘记安装 SSDT-BI,它根本不适用于 VS 2015 (msdn.microsoft.com/en-us/library/jj856966%28v=sql.120%29.aspx)。你应该坚持使用 VS 2013。
标签: c# visual-studio-2013 ssis visual-studio-2015 sql-server-data-tools