Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Unexpected Menu Behavior
 

Unexpected Menu Behavior

I'm updating the WCSF GAT to fit the particular needs of a client. I'm adding the ability to create a service and would like to have a new menu item in the context menu of a solution project which gives this option (Right-click project -> Web App Start Kit -> Service (C#)

This is in thepackage xml file:

<HostData>

...

<Menu Name="MyGATWCSFProject" Text="Web App Starter Kit" Priority="1">

<CommandBar Name="Project"/>

</Menu>

..

</HostData>

And this is in my both the C# and VB flavors of the Service Recipe definition:

<Caption>Add Service (C#)</Caption>

<Description>Add Service (C#)</Description>

<HostData>

<Icon ID="689" />

<CommandBar Menu="MyGatWCSFProject"/>

</HostData>

(The caption and description of the VB services say "Add Service (VB)")

Both Add Service options appear when I right-click on a C# project, but not when right-clicking on a VB project. I've unregistered, compiled. and re-registered the package several times. I avoiding using QuickRegister when testing for the menu.

What am I missing?

Thanks,

John

John Iwasz  Tuesday, October 23, 2007 11:37 PM
Hi John,
Is that recipe bound or unbound? If it's an unbound recipe you should have a reference associated with it. That's in the BindingRecipe so, you have to check what is it doing in the IsEnabledFor method. Most probably that's returning true just for the C# projects.

hth
jose.
Jose Escrich  Wednesday, October 24, 2007 2:01 PM
Hi John,
Is that recipe bound or unbound? If it's an unbound recipe you should have a reference associated with it. That's in the BindingRecipe so, you have to check what is it doing in the IsEnabledFor method. Most probably that's returning true just for the C# projects.

hth
jose.
Jose Escrich  Wednesday, October 24, 2007 2:01 PM

Jose,

Thanks. That sent me down the right path.

The recipe was unbound and using the right value for the IsEnableForProperty and I did confirm that the property was in the BusinessModule.vbproj. However,the action in my Bindings.xml file was using thewrong reference type:

<Action Name="CreateServiceRefVB" Type="RefCreator" AssetName="CreateServiceVB"

ReferenceType="MyClient.Practices.WebClientFactory.References.ProjectPropertyReferenceCS, MyClient.Practices.WebClientFactory.GuidancePackage"

IsEnabledForProperty="IsModuleProject"/>

Once I changed it to ProjectPropertyReferenceVB it worked.

For what it's worth, I did find a missing IsModuleProject property in the Templates\Projects\Module.VB\FoundationalModule.vbproj file. It's missing:

<ProjectExtensions>

<VisualStudio>

<UserProperties IsModuleProject="True" />

</VisualStudio>

</ProjectExtensions>

The Templates\Projects\Module.CS\FoundationalModule.csproj file has it.

This was in changeset 27528 of the WCSF.

- John

John Iwasz  Wednesday, October 24, 2007 4:46 PM
cool,
regarding any issue with the WCSF, try to post in the WCSF specific forum (http://www.codeplex.com/websf/Thread/List.aspx) in where the dev team will can help you, and get your feedback.
Jose Escrich  Wednesday, October 24, 2007 4:51 PM

You can use google to search for other answers

Custom Search

More Threads

• Guidance automation toolkit(February 2007 CTP) is unable to be installed
• Throwing error when data set has large amount of data binding with crystal report
• GAT and DSL
• Modified guidance pakcage quits working suddenly
• Guidance don´t unload the AppDomain
• How do I automate the inclusion of source files in visual studio projects?
• Getting the path of the solution
• Best Practices for GP?
• What causes the project to be added under Guidance Packages when creating a new project?
• Problems with Adding WCF Guidance Package