2

更新: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のツールボックスに追加できます...しかし、デザイナーにドラッグしようとするとエラーが表示されます。 ..。。

4

2 に答える 2

0

GACおよびタスクフォルダーからdllを削除し、再作成しました

于 2011-12-14T22:50:17.907 に答える
0

BIDS を再起動し、GAC とタスク フォルダーから dll を削除し、プロセス全体をやり直した後、問題を解決することができました。何が間違っていたのか正確にはわかりませんが、試してみる価値はあります。

于 2012-01-15T11:30:09.330 に答える