0
votes

I am facing an issue while trying to open editor for custom control flow component. I tried to copied the dll where package resides but didn't help. Please do let me know if I am doing anything wrong or how to fix this issue.

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
    }
}

Error is related the user interface which is been attached to custom control flow, its basically you can create 2 types of control flow components one is simple transformation and another you can also have some UI to get user input, ssis will allows you to double click on the component and provide the values...so when I double click on the com to get UI its throws error.. TITLE: Microsoft Visual Cannot show the editor for this task. The task user interface specified by type name 'CopyTableTaskUI, CopyTable, Version=1.0.0.0,Culture=Neutral, PublicKeyToken=9097a336d1055e0b' could not be loaded. Could not load file or assembly 'CopyTable, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9097a336d1055e0b' or one of its dependencies. The

1
What is the issue? If you are getting an error please post it. Exactly which editor are yuo trying to open? - Nick.McDermaid
Error is related the user interface which is been attached to custom control flow, its basically you can create 2 types of control flow components one is simple transformation and another you can also have some UI to get user input, ssis will allows you to double click on the component and provide the values...so when I double click on the com to get UI its throws error.. - user2185212
In short, your custom control is not installed properly. - Nick.McDermaid
ElectricLlama - How can we make sure its installed correctly - user2185212
You need to speak to whoever built the custom control. If it's a purchased 3rd party control, get support. If it's internally developed, find the developer. Sorry I can't help further, I can only tell you that a UI issue like this is an installation issue. - Nick.McDermaid

1 Answers

0
votes

I had a similar problem with error "Could not load type: " followed by "Verify that the component editor is installed properly.". The issue came up when I deployed my dll in a client machine, and it showed up after re-editing the DTSX package in a second session after creation.The custom UI won't show up.

I got rid of this issue by copying my custom dll to the folder where Visual Studio resides (devenv.exe). This VS was a shell version, suitable for creation of DTSX packages and little else.

Installing my DLL in the GAC didn't help. I must mention that my package was not strong signed, but I ran an exception using "reg file / Merge" to no avail.