Locked Actions don't get executed

  • Wednesday, December 19, 2007 12:37 PM
     
     

     

    Hello everyone,

     

    I have the following Actions declared:

     

    <Actions>

    <Action Name="AddProjectReferences" Type="MyNamespace.Actions.AddProjectReferencesAction, MyNamespace">

    <Input Name="CustomerName" RecipeArgument="CustomerName" />

    <Input Name="CustomerProjectName" RecipeArgument="CustomerProjectName" />

    </Action>

    <Action Name="RenameSolution" Type="MyNamespace.Actions.RenameSolutionAction, MyNamespace">

    <Input Name="NewSolutionName" RecipeArgument="FinalSolutionName" />

    </Action>

    </Actions>

     

    When I register my guidance package, and try it out, I can find my actions in the Guidance Package Manager, but they are just not executed. No references are made and my solution is not renamed (and it's code that has been used in other projects and does work).

     

    Does anyone know why this could occur?

     

    Thanks in advance,

    Nocto

All Replies

  • Wednesday, December 19, 2007 2:28 PM
     
     Answered
    Hi,

    You need to place those actions into a <Recipe> element then if you want to execute it when the solution is unfolded you also have to specify it into the solution .vstemplate as follow...

        <WizardData>
            <Template xmlns="http://schemas.microsoft.com/pag/gax-template"
                  SchemaVersion="1.0"
                  Recipe="YourRecipeName"/>
       </WizardData>

    If you still have troubles, please post all your recipe definition and where/when you want to execute it.

    hth
    jose.
  • Wednesday, December 19, 2007 3:33 PM
     
     

    <Recipe Name="CreateProjects">

    <Types>

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

    </Types>

    <Caption>Creates a new basic project.</Caption>

    <Arguments>

    <Argument Name="CustomerName" Required="true">

    <Converter Type="Microsoft.Practices.RecipeFramework.Library.Converters.CodeIdentifierStringConverter, Microsoft.Practices.RecipeFramework.Library" />

    </Argument>

    <Argument Name="CustomerProjectName" Required="true">

    <Converter Type="Microsoft.Practices.RecipeFramework.Library.Converters.NamespaceStringConverter, Microsoft.Practices.RecipeFramework.Library" />

    </Argument>

    <Argument Name="BusinessProjectName">

    <ValueProvider Type="Evaluator" Expression="Prefix.$(CustomerName).$(CustomerProjectName).Business">

    <MonitorArgument Name="CustomerName" />

    <MonitorArgument Name="CustomerProjectName" />

    </ValueProvider>

    </Argument>

    <Argument Name="CommonProjectName">

    <ValueProvider Type="Evaluator" Expression="Prefix.$(CustomerName).$(CustomerProjectName).Common">

    <MonitorArgument Name="CustomerName" />

    <MonitorArgument Name="CustomerProjectName" />

    </ValueProvider>

    </Argument>

    <Argument Name="DalProjectName">

    <ValueProvider Type="Evaluator" Expression="Prefix.$(CustomerName).$(CustomerProjectName).DAL">

    <MonitorArgument Name="CustomerName" />

    <MonitorArgument Name="CustomerProjectName" />

    </ValueProvider>

    </Argument>

    <Argument Name="WebUIProjectName">

    <ValueProvider Type="Evaluator" Expression="Prefix.$(CustomerName).$(CustomerProjectName).WebUI">

    <MonitorArgument Name="CustomerName" />

    <MonitorArgument Name="CustomerProjectName" />

    </ValueProvider>

    </Argument>

    <Argument Name="WinUIProjectName">

    <ValueProvider Type="Evaluator" Expression="Prefix.$(CustomerName).$(CustomerProjectName).WinUI">

    <MonitorArgument Name="CustomerName" />

    <MonitorArgument Name="CustomerProjectName" />

    </ValueProvider>

    </Argument>

    <Argument Name="FinalSolutionName">

    <ValueProvider Type="Evaluator" Expression="Prefix.$(CustomerName).$(CustomerProjectName).sln">

    <MonitorArgument Name="CustomerName" />

    <MonitorArgument Name="CustomerProjectName" />

    </ValueProvider>

    </Argument>

    </Arguments>

    <Actions>

    <Action Name="AddProjectReferences" Type="Prefix.SmartToolsGAT.Actions.AddProjectReferencesAction, Prefix.SmartToolsGAT">

    <Input Name="CustomerName" RecipeArgument="CustomerName" />

    <Input Name="CustomerProjectName" RecipeArgument="CustomerProjectName" />

    </Action>

    <Action Name="RenameSolution" Type="Prefix.Actions.RenameSolutionAction, Prefix.SmartToolsGAT">

    <Input Name="NewSolutionName" RecipeArgument="FinalSolutionName" />

    </Action>

    </Actions>

    </Recipe>

     

    <WizardData>

    <Template xmlns="http://schemas.microsoft.com/pag/gax-template"

    SchemaVersion="1.0"

    Recipe="CreateSolution">

    <References>

    <RecipeReference Name="CreateProject" Target="\" />

    <RecipeReference Name="AddWebProject" Target="\"/>

    </References></Template>

    </WizardData>

     

    I just want the actions to execute when a new project is created using this guidance package. I know it starts off with another recipe, but I referenced it as here above, so normally it should execute or not?

     

    I'm sorry if I'm asking silly questions, but I'm a newbie regarding GAT!

    Thanks for all your help!

    Nocto

  • Wednesday, December 19, 2007 3:53 PM
     
     

    Ok, well what you have there is just a reference and that's no means that the recipe will automatically execute after the template unfolding. That just a reference, is like a declaration to place a command called "CreateProject" @ Root

    There you just can add references to bound recipes, in your sample that means that when you do a right click over a Root (/ or Solution Node), you will see a command called "CreateProject" which able to execute the recipe.

    Take a quick look to GAX documentation or to the default Guidance Package which is created by GAT. There is explained what's the difference between bound and unbound recipes and how you can bind that recipes.

    Anyway if you have troubles don't hesitate to ask.

    jose.
  • Wednesday, November 02, 2011 6:43 AM
     
     

    Hi Jose,

    I am trying to use GAT to create a solution template which may contain few projects. I am trying to add reference of one project to another. I am using AddProjectReference Action in my recipe but when I try to create the solution using this package template, I get error - Action AddProjectReference failed. Can you provide me some steps on how to add project references using GAT? Please let me know if you need more details.

    Thanks

    Parag


    PD