【发布时间】:2021-09-12 16:18:27
【问题描述】:
我一直在尝试为 Knight 的 MS SSIS 24 小时教练解决练习。
我在包中有一个脚本任务,它检查变量的值并显示一个消息框。除此以外没有其他组件。
当我尝试构建脚本任务代码时,它给出了错误 -
One or more errors occurred.
Project = ST_<GUID#>. File = mscorlib
脚本任务源码如下:
public void Main()
{
// TODO: Add your code here
if ((int)Dts.Variables["User::intVar"].Value >= 10)
Dts.Variables["User::strVar"].Value = "Big";
else
Dts.Variables["User.strVar"].Value = "Small";
MessageBox.Show(Dts.Variables["User::strVar"].Value.ToString());
Dts.TaskResult = (int)ScriptResults.Success;
}
在运行包时,我收到错误:
The Binary code for the script task is not found.
Please open the script in the designer and make sure it builds successfully.
我已经尝试了几乎所有可以在 Stack Overflow 上找到的东西:
-
Set DelayValidation = True,重启电脑,将包导入新项目。 - 删除整个项目并重新构建。
- 清理构建等
【问题讨论】:
-
事实证明,我编写的所有脚本任务都遇到了同样的错误。有没有办法解决这个问题?
-
你的 else 变量的编码不同,因为它在引号中,所以它不会编译为错误。
标签: ssis script-task