【问题标题】:Error while loading editor for custom control flow component in ssis 2012在 ssis 2012 中为自定义控制流组件加载编辑器时出错
【发布时间】:2013-04-17 06:11:20
【问题描述】:

我在尝试打开自定义控制流组件的编辑器时遇到问题。我试图复制包所在的dll,但没有帮助。如果我做错了什么或如何解决此问题,请告诉我。

Here is the code:
Main class inherits TASK                         

namespace SSIS.Custom.ControlFlowUI
{
        [DtsTask  (
       DisplayName = "CopyTable",
       Description = "A custom Unzip task for demonstration purposes.",
       TaskType = "CustomComponent",
       UITypeName = "CopyTableTaskUI, CopyTable, Version=1.0.0.0,Culture=Neutral, PublicKeyToken=9097a336d1055e0b")]

    public class CopyTable : Task
    {
         #region Override methods

            public override DTSExecResult Validate(Connections connections,
            VariableDispenser variableDispenser, IDTSComponentEvents componentEvents,
            IDTSLogging log)
            {
                return base.Validate(connections, variableDispenser, componentEvents, log);
            }

            public override DTSExecResult Execute(Connections connections, VariableDispenser variableDispenser, IDTSComponentEvents componentEvents, IDTSLogging log, object transaction)
            {
                try
                {
                    ValidateSchema(@"GGN19\MSSQL12");

                    //   Return success.
                    return DTSExecResult.Success;
                }
                catch (System.Exception exception)
                {
                    //   Capture exceptions, post an error, and fail validation.

                    return DTSExecResult.Failure;
                }
            }
        #endregion

        #region Public methods

            public string ValidateSchema(string tableName)
            {
                GetTableList(tableName);
                return "";
            }

            private List<string> GetTableList(string ServerName)
            {
                List<string> lTables = new List<string>();
                try
                {

                    SqlConnection dbConn = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=TestingTmp;Data Source=" + ServerName);
                    SqlCommand dbCmd = new SqlCommand("Select NAME from sysobjects where type ='U';", dbConn);
                    dbConn.Open();
                    SqlDataReader SqlDR = dbCmd.ExecuteReader();

                    while (SqlDR.Read())
                    {
                        lTables.Add(SqlDR.GetString(0));
                    }
                    dbConn.Close();

                }
                catch (Exception ex) { }
                return lTables;
            }

            private bool ValidateTableSchema(string ServerName, string table1, string table2)
            {
                SqlConnection dbConn = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=msdb;Data Source=" + ServerName);
                SqlCommand dbCmd = new SqlCommand("Select * from '" + table1 + "';", dbConn);
                dbConn.Open();
                SqlDataReader SqlDR = dbCmd.ExecuteReader();
                DataTable schema = SqlDR.GetSchemaTable();


                dbCmd = new SqlCommand("Select * from '" + table2+  "';", dbConn);
                dbConn.Open();
                SqlDR = dbCmd.ExecuteReader();
                DataTable schema2 = SqlDR.GetSchemaTable();

                return schema.Equals(schema2);

             }

        #endregion

       }

UI Class
namespace ControlFlowUI
{
    public class CopyTableTaskUI : IDtsTaskUI
    {

        #region // Fields
         private TaskHost _taskHost;
        #endregion

        #region Properties

        #endregion

        #region Methods

         public void Initialize(TaskHost taskHost, IServiceProvider serviceProvider)
         {

             _taskHost = taskHost;
         }

         public ContainerControl GetView()
        {

            return new CopyTableFrm(_taskHost);
        }

        #endregion


             #region IDtsTaskUI Members

             public void Delete(IWin32Window parentWindow)
             {
                 throw new NotImplementedException();
             }

             public void New(IWin32Window parentWindow)
             {
                 throw new NotImplementedException();
             }

             #endregion
    }
}

错误与附加到自定义控制流的用户界面有关,基本上你可以创建两种类型的控制流组件一种是简单的转换,另一种你也可以有一些 UI 来获取用户输入,ssis 将允许你双击组件并提供值...所以当我双击 com 以获取 UI 时,它会抛出错误.. TITLE: Microsoft Visual 无法显示此任务的编辑器。 无法加载由类型名称“CopyTableTaskUI, CopyTable, Version=1.0.0.0,Culture=Neutral, PublicKeyToken=9097a336d1055e0b”指定的任务用户界面。 无法加载文件或程序集“CopyTable,Version=1.0.0.0,Culture=neutral,PublicKeyToken=9097a336d1055e0b”或其依赖项之一。

【问题讨论】:

  • 有什么问题?如果您收到错误,请发布。你到底想打开哪个编辑器?
  • 错误与附加到自定义控制流的用户界面有关,基本上你可以创建两种类型的控制流组件,一种是简单的转换,另一种你也可以有一些 UI 来获取用户输入,ssis 将允许您双击组件并提供值...所以当我双击 com 以获取 UI 时,它会抛出错误..
  • 总之,你的自定义控件没有正确安装。
  • ElectricLlama - 我们如何确保其安装正确
  • 您需要与构建自定义控件的人交谈。如果是购买的第 3 方控件,请获得支持。如果是内部开发的,找开发者。抱歉,我帮不上忙,我只能告诉你,像这样的 UI 问题是安装问题。

标签: ssis


【解决方案1】:

我遇到了类似的错误“无法加载类型:”,然后是“验证组件编辑器是否已正确安装。”。当我在客户端机器上部署我的 dll 时出现了这个问题,它在创建后的第二个会话中重新编辑 DTSX 包后出现。自定义 UI 不会出现。

我通过将自定义 dll 复制到 Visual Studio 所在的文件夹 (devenv.exe) 解决了这个问题。这个 VS 是一个 shell 版本,适合创建 DTSX 包等等。

在 GAC 中安装我的 DLL 没有帮助。我必须提到我的包没有强签名,但是我使用“reg file / Merge”运行了一个异常,但无济于事。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-28
    • 1970-01-01
    • 2011-03-12
    • 1970-01-01
    相关资源
    最近更新 更多