SSIS 无法创建此任务?

发布于 2024-12-10 07:20:51 字数 3586 浏览 1 评论 0原文

更新: 重新启动我的 BIDS、从 GAC 和任务文件夹中删除我的 dll 并重做整个过程后,我能够解决问题。所以我不知道到底出了什么问题,但这是值得尝试的事情。


所以我有与这里完全相同的问题: 为什么 SSIS 无法创建此任务?

具有以下内容任务:

using System;
using Microsoft.SqlServer.Dts.Runtime;
using System.IO;

namespace BloombergRequest
{
    [DtsTask(DisplayName= "BBG Request",
        Description= "A custom task for sending bloomberg requests",
        TaskContact = "BBG Request; OTC Fin Europe; Developed by N. Wadike - 2011.",
        TaskType= "Custom BBG task")]
    public class BBGRequest : Task
    {
        #region Constructors
        public BBGRequest()
        {
            //explode parameters into arrays and store in private fields
            _fields = Fields.Split(new Char[] { ',' });
            _headerOptions = HeaderOptions.Split(new Char[] { ',' });
            _headerValues = HeaderValues.Split(new Char[] { ',' });
            _securitiesValues = Securities.Split(new Char[] { ',' });
        }
        #endregion

        #region Override base methods

        public override DTSExecResult
            Execute(Connections connections,
            VariableDispenser variableDispenser,
            IDTSComponentEvents componentEvents,
            IDTSLogging log,
            object transaction)
        {
            try
            {
                SendRequest();
            }
            catch 
            {
                return DTSExecResult.Failure;
            }

            return DTSExecResult.Success;
        }

        public override DTSExecResult Validate(
            Connections connections,
            VariableDispenser variableDispenser,
            IDTSComponentEvents componentEvents,
            IDTSLogging log)
        {...validate my inputs}

        #endregion

        #region Private methods

        private void SendRequest()
        {
            CreateHeader();
        }

        private void CreateHeader()
        {...do some stuff...}

        #endregion

        #region Properties
        public string Fields { get; set; }
        public string HeaderOptions { get; set; }
        public string HeaderValues { get; set; }
        public string OutputFolderPath { get; set; }
        public string Securities { get; set; }

        private string[] _fields;
        private string[] _headerOptions;
        private string[] _headerValues;
        private string[] _securitiesValues;

        #endregion
    }
}

我按照上面链接的问题中解释的步骤进行操作,但它没有解决我的问题。这是我的错误:

===================================

Failed to create the task. (Microsoft Visual Studio)

===================================

Cannot create a task with the name "BloombergRequest.BBGRequest, BloombergRequest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c0c17a53adc44091". Verify that the name is correct.
 (BBG_REQ)

------------------------------
Program Location:

   at Microsoft.SqlServer.Dts.Runtime.Executables.Add(String moniker)
   at Microsoft.DataTransformationServices.Design.DtsBasePackageDesigner.CreateExecutable(String moniker, IDTSSequence container, String name)

===================================

Cannot create a task with the name "BloombergRequest.BBGRequest, BloombergRequest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c0c17a53adc44091". Verify that the name is correct.
 (BBG_REQ)

------------------------------

我的项目称为 BloombergRequest,类是 BBGRequest... 我已经检查过,该 dll 位于 GAC 中,我可以将其添加到 BIDS 中的工具箱中...但是当我尝试将其拖到设计器上时,会弹出错误...

UPDATE:
After having restarted my BIDS, deleted my dll from GAC and task folder, and redoing the whole process, I was able to sort things out. So I don't know exactly what was wrong but that's something worth trying.


So I have exactly the same problem as here:
Why does SSIS fail to create this task?

with the following task:

using System;
using Microsoft.SqlServer.Dts.Runtime;
using System.IO;

namespace BloombergRequest
{
    [DtsTask(DisplayName= "BBG Request",
        Description= "A custom task for sending bloomberg requests",
        TaskContact = "BBG Request; OTC Fin Europe; Developed by N. Wadike - 2011.",
        TaskType= "Custom BBG task")]
    public class BBGRequest : Task
    {
        #region Constructors
        public BBGRequest()
        {
            //explode parameters into arrays and store in private fields
            _fields = Fields.Split(new Char[] { ',' });
            _headerOptions = HeaderOptions.Split(new Char[] { ',' });
            _headerValues = HeaderValues.Split(new Char[] { ',' });
            _securitiesValues = Securities.Split(new Char[] { ',' });
        }
        #endregion

        #region Override base methods

        public override DTSExecResult
            Execute(Connections connections,
            VariableDispenser variableDispenser,
            IDTSComponentEvents componentEvents,
            IDTSLogging log,
            object transaction)
        {
            try
            {
                SendRequest();
            }
            catch 
            {
                return DTSExecResult.Failure;
            }

            return DTSExecResult.Success;
        }

        public override DTSExecResult Validate(
            Connections connections,
            VariableDispenser variableDispenser,
            IDTSComponentEvents componentEvents,
            IDTSLogging log)
        {...validate my inputs}

        #endregion

        #region Private methods

        private void SendRequest()
        {
            CreateHeader();
        }

        private void CreateHeader()
        {...do some stuff...}

        #endregion

        #region Properties
        public string Fields { get; set; }
        public string HeaderOptions { get; set; }
        public string HeaderValues { get; set; }
        public string OutputFolderPath { get; set; }
        public string Securities { get; set; }

        private string[] _fields;
        private string[] _headerOptions;
        private string[] _headerValues;
        private string[] _securitiesValues;

        #endregion
    }
}

I followed the steps explained in the question linked above and it didn't solve my problem. This is my error:

===================================

Failed to create the task. (Microsoft Visual Studio)

===================================

Cannot create a task with the name "BloombergRequest.BBGRequest, BloombergRequest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c0c17a53adc44091". Verify that the name is correct.
 (BBG_REQ)

------------------------------
Program Location:

   at Microsoft.SqlServer.Dts.Runtime.Executables.Add(String moniker)
   at Microsoft.DataTransformationServices.Design.DtsBasePackageDesigner.CreateExecutable(String moniker, IDTSSequence container, String name)

===================================

Cannot create a task with the name "BloombergRequest.BBGRequest, BloombergRequest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c0c17a53adc44091". Verify that the name is correct.
 (BBG_REQ)

------------------------------

My project is called BloombergRequest, the class is BBGRequest...
I have checked and the dll is in GAC and I can add it to my toolbox in BIDS... But the error pops up when I try and drag it onto the designer....

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

纵山崖 2024-12-17 07:20:51

从 GAC 和任务文件夹中删除我的 dll,然后重新创建

Deleted my dll from GAC and task folder, and recreate

耳根太软 2024-12-17 07:20:51

重新启动我的 BIDS、从 GAC 和任务文件夹中删除我的 dll 并重做整个过程后,我能够解决问题。所以我不知道到底出了什么问题,但这是值得尝试的事情。

After having restarted my BIDS, deleted my dll from GAC and task folder, and redoing the whole process, I was able to sort things out. So I don't know exactly what was wrong but that's something worth trying.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文