Chào các bạn !

Mình làm 1 Addin để chèn vài cái component vào toolbox theo hướng dẫn trong MSDN của Microsoft nhưng làm mãi không được, nó chỉ thêm được "New ToolBox Tab", mà không thể thêm 2 item và mấy cái component trong file .dll của mình vào tab "New ToolBox Tab". Nó toàn báo lỗi không hà.
Bạn nào rành chuyện này hướng dẫn mình với. Code như thế này:

public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
_applicationObject = (DTE2)application;
_addInInstance = (AddIn)addInInst;

ToolboxExample(_applicationObject);
}

public void ToolboxExample(DTE2 dte)
{
ToolBox tlBox = null;
ToolBoxTabs tbxTabs = null;
ToolBoxTab2 tbxTab = null;
try
{
// Create an object reference to the IDE's ToolBox object and
// its tabs.
tlBox = (ToolBox)(dte.Windows.Item(Constants.vsWindowKindT oolbox).Object);
tbxTabs = tlBox.ToolBoxTabs;

// Add a new tab to the Toolbox and select it.
tbxTab = (ToolBoxTab2)tbxTabs.Add("New ToolBox Tab");
tbxTab.Activate();

// Add new items to the new Toolbox tab. This shows two
// different ways to index the Toolbox tabs. The third item
// added is a .NET component that contains a number of
// Web-related controls.
tbxTab.ToolBoxItems.Add("Text Item", "Hello world",(EnvDTE.vsToolBoxItemFormat.vsToolBoxItemFo rmatText));
tbxTab.ToolBoxItems.Add("HTML Item", "Hello world", vsToolBoxItemFormat.vsToolBoxItemFormatHTML);
// Replace the <Path and name of a .NET dll>
// with a path to a .NET dll file.
tbxTabs.Item("New Toolbox Tab").ToolBoxItems.Add("DotNET Component",
"C:\\MyComponent.dll",vsToolBoxItemFormat.vsToolBo xItemFormatDotNETComponent);
}
catch (System.Exception ex)
{
MessageBox.Show("ERROR: " + ex.Message);
}
}