"Object must be the same type as the enum" exception calling CommandBars.Add from an add-in - by Carlos J. Quintero

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<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 462766 Comments
Status Closed Workarounds
Type Bug Repros 2
Opened 6/1/2009 7:41:41 AM
Access Restriction Public


When you create an add-in with the wizard and make this call:

toolBar = commandBars.Add(Name:="My toolbar", Position:=Microsoft.VisualStudio.CommandBars.MsoBarPosition.msoBarTop, Temporary:=True)

you get the exception:

"Object must be the same type as the enum. The type passed in was 'Microsoft.VisualStudio.CommandBars.MsoBarPosition'; the enum type was 'Microsoft.VisualStudio.CommandBars.MsoBarPosition'."
Sign in to post a comment.
Posted by Microsoft on 10/23/2009 at 7:18 PM
Many thanks for reporting this issue. It will be fixed in .NET Framework 4.0 RC/RTM releases.

Ladi Prosek, CLR team
Posted by Microsoft on 6/2/2009 at 11:21 PM
Thanks for your feedback.

We are escalating this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Thank you,
Visual Studio Product Team