Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Basic example don't work
 

Basic example don't work

what can be wrong in this package?

<?xml version="1.0" encoding="utf-8" ?>

<GuidancePackage xmlns="http://schemas.microsoft.com/pag/gax-core"

Name="GPackage"

Caption="GPackage"

Description="GPackage"

Guid="18da9048-c54d-4690-a005-b82c542a829d"

SchemaVersion="1.0">

<Recipes>

<Recipe Name="ShowCurrentSelection" Bound="false">

<Caption>Show current selection</Caption>

<HostData>

<CommandBar Name="Solution" />

<CommandBar Name="Solution Folder" />

<CommandBar Name="Project" />

<CommandBar Name="Folder" />

<CommandBar Name="Item" />

</HostData>

<Actions>

<Action Name="ShowCurrent" Type="Microsoft.Services.GPackage.Actions.ShowCurrentSelection, Microsoft.Services.GPackage" />

</Actions>

</Recipe>

</Recipes>

</GuidancePackage>

it is a simple package of test.

it was created with the package solution, and it was modified. Leaving only one recipe

It compile correctly

It is perfect registered

When enable the guidance in a project, it is perfect loaded, but the recipe is not visible.

Leandro Tuttini  Tuesday, August 28, 2007 6:11 PM
Please take a look at this post: http://blogs.msdn.com/wojtek/archive/2005/05/17/418706.aspx

If you want to use an Unbound recipe, you should implement the reference extending from UnboundRecipeReference and adding a RefCreator action in the Binding recipe. For example this is how the initial Guidance Package created with GAT adds a reference for the AddRecipeReference recipe:

<Recipe Name="BindingRecipe">
<Types>
<TypeAlias Name="RefCreator" Type="Microsoft.Practices.RecipeFramework.Library.Actions.CreateUnboundReferenceAction, Microsoft.Practices.RecipeFramework.Library"/>
</Types>
<Caption>Creates unbound references to the guidance package</Caption>
<Actions>
<Action Name="CreateUnboundRecipeRef" Type="RefCreator" AssetName="AddRecipeReference"
ReferenceType="GuidancePackage5.References.AnyElementReference, GuidancePackage5" />
</Actions>
</Recipe>

If you want to use a Bound recipe the easier way is to add the reference in .vstemplate.

HTH,
-Adrian

Adrian Alonso  Tuesday, August 28, 2007 7:47 PM
Hi Leandro, you are missing the recipe's reference. In order to add the reference you can use a .vstemplate or the Binding recipe.


-Adrian
Adrian Alonso  Tuesday, August 28, 2007 7:10 PM

Thanks Adrian, for your answer.

I tested with the follow definition of guidance.

But it continue without show me the recipe.

<?xml version="1.0" encoding="utf-8" ?>

<GuidancePackage xmlns="http://schemas.microsoft.com/pag/gax-core"

Name="GPackage"

Caption="GPackage"

Description="GPackage"

Guid="18da9048-c54d-4690-a005-b82c542a829d"

BindingRecipe="BindingRecipe"

SchemaVersion="1.0">

<Recipes>

<Recipe Name="BindingRecipe">

<Types>

<TypeAlias Name="RefCreator" Type="Microsoft.Practices.RecipeFramework.Library.Actions.CreateUnboundReferenceAction, Microsoft.Practices.RecipeFramework.Library"/>

</Types>

<Caption>Creates unbound references to the guidance package</Caption>

</Recipe>

<Recipe Name="ShowCurrentSelection" >

<Caption>Show current selection</Caption>

<HostData>

<CommandBar Name="Solution" />

<CommandBar Name="Solution Folder" />

<CommandBar Name="Project" />

<CommandBar Name="Folder" />

<CommandBar Name="Item" />

</HostData>

<Actions>

<Action Name="ShowCurrent" Type="Microsoft.Services.GPackage.GuidancePackage.Actions.ShowCurrentSelection, Microsoft.Services.GPackage.GuidancePackage" />

</Actions>

</Recipe>

</Recipes>

</GuidancePackage>

I try specify the atributte Bound in the recipe, but nothing

Leandro Tuttini  Tuesday, August 28, 2007 7:33 PM
Please take a look at this post: http://blogs.msdn.com/wojtek/archive/2005/05/17/418706.aspx

If you want to use an Unbound recipe, you should implement the reference extending from UnboundRecipeReference and adding a RefCreator action in the Binding recipe. For example this is how the initial Guidance Package created with GAT adds a reference for the AddRecipeReference recipe:

<Recipe Name="BindingRecipe">
<Types>
<TypeAlias Name="RefCreator" Type="Microsoft.Practices.RecipeFramework.Library.Actions.CreateUnboundReferenceAction, Microsoft.Practices.RecipeFramework.Library"/>
</Types>
<Caption>Creates unbound references to the guidance package</Caption>
<Actions>
<Action Name="CreateUnboundRecipeRef" Type="RefCreator" AssetName="AddRecipeReference"
ReferenceType="GuidancePackage5.References.AnyElementReference, GuidancePackage5" />
</Actions>
</Recipe>

If you want to use a Bound recipe the easier way is to add the reference in .vstemplate.

HTH,
-Adrian

Adrian Alonso  Tuesday, August 28, 2007 7:47 PM

Many thanks Adrian.

Finally I understood the difference in bound and unbound recipes, and I've been able to resolve the problem with the follow especification:

<?xml version="1.0" encoding="utf-8" ?>

<GuidancePackage xmlns="http://schemas.microsoft.com/pag/gax-core"

Name="GPackage"

Caption="GPackage"

Description="GPackage"

Guid="18da9048-c54d-4690-a005-b82c542a829d"

BindingRecipe="BindingRecipe"

SchemaVersion="1.0">

<HostData>

<Menu Name="GProject" Text="Guidance" Priority="1">

<CommandBar Name="Project" />

</Menu>

<Menu Name="GFolder" Text="Guidance" Priority="1">

<CommandBar Name="Folder" />

</Menu>

</HostData>

<Recipes>

<Recipe Name="BindingRecipe">

<Types>

<TypeAlias Name="RefCreator" Type="Microsoft.Practices.RecipeFramework.Library.Actions.CreateUnboundReferenceAction, Microsoft.Practices.RecipeFramework.Library"/>

</Types>

<Caption>Creates unbound references to the guidance package</Caption>

<Actions>

<Action Name="ShowCurrentSelectionPrueba" Type="RefCreator" AssetName="ShowCurrentSelection"

ReferenceType="Microsoft.Services.GPackage.GuidancePackage.References.AnyElementReference, Microsoft.Services.GPackage.GuidancePackage" />

</Actions>

</Recipe>

<Recipe Name="ShowCurrentSelection" Bound="false">

<Caption>Show current selection</Caption>

<HostData>

<Icon ID="172" />

<CommandBar Menu="GProject" />

<CommandBar Menu="GFolder" />

</HostData>

<Actions>

<Action Name="ShowCurrent" Type="Microsoft.Services.GPackage.GuidancePackage.Actions.ShowCurrentSelection, Microsoft.Services.GPackage.GuidancePackage" />

</Actions>

</Recipe>

</Recipes>

</GuidancePackage>

It work perfect

Leandro Tuttini  Thursday, August 30, 2007 5:40 PM

You can use google to search for other answers

Custom Search

More Threads

• Passing a XmlSerializer Class To T4 template
• How to generate a template from an existing class file
• Update an installed factory
• Workaround for the UnfoldTemplateAction and parameter replacements
• Access Denied error on Install of Feb GAT
• Error while displaying the Current Project name in a Text box of a Custom Wizard Page
• Web Service Software Factory (WCF) - cannot add service reference
• Sharing gpState in TFS Source Control
• C++ in GAX
• Creating a Recipe for updating a config file