Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Add guadiance automation to existing solution?
 

Add guadiance automation to existing solution?

Hi,
I've created GA package which creates whole solution with some projects. Every project has bound some recipes on its context menu. Everything works fine. But I'd like to use my package with existing solution, not created from this package. Every solution has the same projects structure, and using project name i can specify which recipes should be bound to it. Maybe someone has an idea how to achieve that functionality?
I'm working on VS2008...
thanks for help!
Albin123  Thursday, September 17, 2009 9:25 AM
Hi

I had a similar problem and resolved it as follows. I created a new unbound recipe called "BindRecipesToExistingSolution". I instructed the developers to use the "Guidance Package Manager" option in Visual Studio to enable my guidance package on the existing solution. Once my guidance package is enabled the unbound recipes will be available in the Guidance Package Manager window. I instructed the developers to then execute my BindRecipesToExistingSolution recipe. It asks the developers toassociate the names of the projects in the existing solution to arguments in the recipe.

I then used a custom action to associate the recipes / templates to the projects:

<Action Type="Test.GuidedAutomation.Actions.AddNewBoundReferenceToProject, TestCGuidancePackage" Name="AddCreatorRecipe">

<

Input Name="CurrentProject" RecipeArgument="CreatorProject" />

<

Input Name="RecipeName" RecipeArgument="CreatorRecipeName" />

<

Input Name="TemplateName" RecipeArgument="CreatorTemplateName" />

</

Action>


My custom action code looks like this. I firstly add a bound reference to the project using the reference service.

IBoundAssetReference addedReference;

// firstly add a new bound reference in the given project for the given recipe

DTE vs = GetService<DTE>(true);

IAssetReferenceService referenceService = GetService<IAssetReferenceService>(true);

addedReference =

new ProjectReference(recipeName, currentProject);

referenceService.Add(addedReference);


then I needed to add a new BoundTemplateReference to associate the given template with the given project (where templatePath is a path to wherever my templates are installed)

VsBoundReference vsTarget = null;

vsTarget =

new ProjectReference(templatePath, currentProject);

IBoundAssetReference newReference = new BoundTemplateReference(templatePath, vsTarget);

referenceService.Add(newReference);

Hope this helps ...
K









  • Marked As Answer byAlbin123 Thursday, September 24, 2009 1:15 PM
  • Proposed As Answer byKevinH1979 Monday, September 21, 2009 8:54 AM
  •  
KevinH1979  Monday, September 21, 2009 8:54 AM
Hi

I had a similar problem and resolved it as follows. I created a new unbound recipe called "BindRecipesToExistingSolution". I instructed the developers to use the "Guidance Package Manager" option in Visual Studio to enable my guidance package on the existing solution. Once my guidance package is enabled the unbound recipes will be available in the Guidance Package Manager window. I instructed the developers to then execute my BindRecipesToExistingSolution recipe. It asks the developers toassociate the names of the projects in the existing solution to arguments in the recipe.

I then used a custom action to associate the recipes / templates to the projects:

<Action Type="Test.GuidedAutomation.Actions.AddNewBoundReferenceToProject, TestCGuidancePackage" Name="AddCreatorRecipe">

<

Input Name="CurrentProject" RecipeArgument="CreatorProject" />

<

Input Name="RecipeName" RecipeArgument="CreatorRecipeName" />

<

Input Name="TemplateName" RecipeArgument="CreatorTemplateName" />

</

Action>


My custom action code looks like this. I firstly add a bound reference to the project using the reference service.

IBoundAssetReference addedReference;

// firstly add a new bound reference in the given project for the given recipe

DTE vs = GetService<DTE>(true);

IAssetReferenceService referenceService = GetService<IAssetReferenceService>(true);

addedReference =

new ProjectReference(recipeName, currentProject);

referenceService.Add(addedReference);


then I needed to add a new BoundTemplateReference to associate the given template with the given project (where templatePath is a path to wherever my templates are installed)

VsBoundReference vsTarget = null;

vsTarget =

new ProjectReference(templatePath, currentProject);

IBoundAssetReference newReference = new BoundTemplateReference(templatePath, vsTarget);

referenceService.Add(newReference);

Hope this helps ...
K









  • Marked As Answer byAlbin123 Thursday, September 24, 2009 1:15 PM
  • Proposed As Answer byKevinH1979 Monday, September 21, 2009 8:54 AM
  •  
KevinH1979  Monday, September 21, 2009 8:54 AM
Exactly what i need! Great thanks!
Albin123  Thursday, September 24, 2009 1:15 PM

You can use google to search for other answers

Custom Search

More Threads

• Cannot install GAT or any other guidance package
• installation of extentions fails
• Future Roadmap for GAT
• Add WCF Service Reference
• UIPAB
• One Click
• How can you provide input to AddProjectDependencyAction without a wizard?
• t4 help
• Action type??
• When will the mobile software factory installer, June 2006 GAX and GAT dependency, be resolved