Exception DeprecatedException occurs when adding a combobox to vs2010 IDE toolbar - by Joginder Nahil

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 532817 Comments
Status Closed Workarounds
Type Bug Repros 2
Opened 2/11/2010 4:06:47 AM
Access Restriction Public


I used Microsoft.VisualStudio.CommandBars to create a toolbar and add it to the Visual studio IDE. The toolbar hosts buttons and a dropdownlist (Combobox). All work fin in VS 2005 and 2008 but 2010 gives exception:

"Combo box and drop down controls cannot be created via automation."

StackTrace	"   at Microsoft.VisualStudio.PlatformUI.Automation.DynamicCommandBarControls.Add(Object ControlType, Object Id, Object Parameter, Object Before, Object Temporary)     at Microsoft.VisualStudio.PlatformUI.Automation.CommandBarControls._Marshaler.<>c__DisplayClassc.<Add>b__b()     at Microsoft.VisualStudio.Shell.ThreadHelper.Invoke[TResult](Func`1 method)     at Microsoft.VisualStudio.PlatformUI.Automation.CommandBarControls._Marshaler.Add(Object Type, Object Id, Object Parameter, Object Before, Object Temporary)     at vs2010Toolbar.Connect.CreateToolbar() in C:\Users\starprint\Documents\Visual Studio 2010\Projects\vs2010Toolbar\vs2010Toolbar\Connect.vb:line 202"	String

Does anyone has an example showing how to create a toolbar in an Addin that hosts buttons and ComboBoxes and the tollbar can be positioned programatically?

Joginder Nahil

Sign in to post a comment.
Posted by Seamus on 5/24/2010 at 3:10 AM
Is there a sample available yet?
Posted by Microsoft on 3/2/2010 at 12:25 PM
Hello Joginder,

I'll be updating the samples for RC/RTM this week. I will send you an update when they are posted.

Using VSCT within an add-in is not supported. What you will need to do is create a package that will use VSCT to create the commands. Your add-in will then reference the commands in a package. I’ll ask around for a sample for this scenario – an “unofficial” sample may exist. Sorry about any confusion.

Thank you,
Suzanne Hansen, Program Manager, Visual Studio Platform Shell Team
Posted by Joginder Nahil on 2/26/2010 at 2:56 AM
Hello Suzanne,

I tried to run both samples referenced in your reply. The solution file does not load in VS2010 RC. When the project is loaded using .vpprojt, the following errors are reported:
1. 'Visual Basic' is not a member of Microsoft
2. ErrorHandler is not a member of Visual Basic

Please provide example that compile and run.

Also can you provide an example in VB.NET that uses VSCT within an Add-In.

Thank you.
Joginder Nahil
Posted by Microsoft on 2/12/2010 at 3:54 PM
Hello Joginder,

The combobox deprecations that you are encountering in Visual Studio 2010 are by design.

The only way to get the same combobox UI that you had in previous releases would be to create the command bars in VSCT rather than creating them dynamically with DTE. In Visual Studio 2010 comboboxes can only be created/modified through packages. You shouldn't need to migrate all of your product's functionality from an add-in to a package - just your command bar will need to move into a package.

We do have examples of command bars and combo boxes for packages. They were updated for VS 2010 Beta 2 and can be downloaded from:


Thank you,
Suzanne Hansen, Program Manager, Visual Studio Platform Shell Team
Posted by Microsoft on 2/12/2010 at 1:19 AM

Thank you for your feedback, We are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com).