【问题标题】:C# ScriptTask not working when run through Dtexec or SQL Server通过 Dtexec 或 SQL Server 运行时,C# ScriptTask 不起作用
【发布时间】:2022-11-02 04:13:44
【问题描述】:

Identical question with no answers

我的 SSIS 项目存在问题,我无法创建具有 Microsoft.ScriptTask 在其中没有遇到一些奇怪的错误消息。根本问题是Microsoft.ScriptTask 的内容无关紧要。该任务可以是空的,它将导致相同的错误。

在 Visual Studio 中运行的所有脚本都可以正常工作。

我研究了多种解决方案,包括:

  1. Checking in your program files to see if the right version of DTExec is being used. 如摘录所示,我确实使用的是 150 版本,即 SQL Server 2019。
  2. Most solutions on this page 其中包括检查 the package version is the same as the currently downloaded version of SQL Server(它们都是 2019 版本 15)并检查解决方案的加密类型以查看敏感数据是否有问题。
  3. Reinstalling SSDT
  4. Running everything as administrator 从运行 DTExec 的 CMD 到运行代码的 Visual Studio 2019。
  5. Rebuilding the script task
  6. 按照我的前辈的建议,检查 DTExec 是在 32 位还是 64 位上运行。 (如果DTExecProgram Files(x86) 启动,它很可能是32 位。如果它从Program Files 启动,它很可能是64 位)。它确实在 64 位上运行。
  7. 另一个建议是尝试通过 SSMS 的 Agent Profiler 运行包,这会导致相同的错误。
  8. 检查我计算机上的 .Net Framework 版本 (through checking the GAC) 是否与包的目标版本相同。他们都是4.8。
    "C:\Program Files\Microsoft SQL Server\150\DTS\Binn\Dtexec.exe" /f "C:\Directory\Documents\SSIS Tests\TEST_PROJECT\Package.dtsx"
    Microsoft (R) SQL Server Execute Package Utility
    Version 15.0.2000.5 for 64-bit
    Copyright (C) 2019 Microsoft. All rights reserved.
    
    Started:  16:35:16
    Error: 2022-10-20 16:35:17.17
       Code: 0xC001F02A
       Source: Sequence Container
       Description: Cannot create a task from XML for task "Script Task", type "Microsoft.ScriptTask" due to error 0x80070057 "The parameter is incorrect.".
    End Error
    Error: 2022-10-20 16:35:17.17
       Code: 0xC0010018
       Source: Script Task
       Description: Failed to load task "Script Task", type "". The contact information for this task is "".
    End Error
    Error: 2022-10-20 16:35:17.18
       Code: 0xC0010026
       Source: Script Task
       Description: The task has failed to load. The contact information for this task is "".
    End Error
    Error: 2022-10-20 16:35:17.18
       Code: 0xC0024107
       Source: Script Task
       Description: There were errors during task validation.
    End Error
    Error: 2022-10-20 16:35:17.18
       Code: 0xC0010025
       Source: Package
       Description: The package cannot execute because it contains tasks that failed to load.
    End Error
    

    我希望这是足够的信息,并且有人可以提供帮助。谢谢你。

【问题讨论】:

  • 您是否有其他可以测试包的 SQL Server 2019 实例?即:包是否在另一台服务器上成功执行,提示当前服务器上的配置问题?问题服务器是否实际安装了集成服务组件?问题服务器up to date

标签: c# sql-server ssis


【解决方案1】:

根据AlwaysLearning 的评论,问题出在我的SQL Server 安装上。 我最初安装 SQL Server 实例时没有downloaded SSIS,这意味着我的 SSIS 包都没有正常运行。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多