Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Using IAssetReferenceService
 

Using IAssetReferenceService

I just can't figure out how to use this.

I'm trying to launch a set of recipe's based on checkboxes being checked in a solution recipe's wizard page.

For example we have the following options are all inputs to my Create Solution Recipe (they are all boolean values, so they are represented by checkboxes):

[] Use Enterprise Library Data Access
[] Use Enterprise Library Logging
[] Use Enterprise Library Tracing
[] Use Enterprise Library Exception Handling

I would like to then execute all the recipes that are selected, but IAssetReferenceService (which seems to be the way to get access to a RecipeReference has some parameters that I don't seem to understand. What is the target parameter in the GetReferenceFor method? Is this the method I should be using to Spawn Recipes?

Your help is greatly appreciated.
KiddKane  Tuesday, June 21, 2005 1:15 PM
Bound references must be attached to a given target. You create a SolutionReference, SolutionFolderReference, ProjectReference or ProjectItemReference pointing to a given recipe. Then, you hand that reference over to the IAssetReferenceService. All these reference classes exist in the Microsoft.Practices.RecipeFramework.VisualStudio.dll assembly.

The constructor for those classes receive the concrete item being pointed (the target), so you will need to locate it first. For that, you can use the DteHelper.FindXXByPath, which receives the "virtual path" to the target. The "virtual path" is the path representation relative to the solution root in the Solution Explorer.

With those two pieces, you are all set to store a bound reference in the IAssetReferenceService and have the recipe appear in the designated target context menu (as well as the task list).
kzu  Tuesday, June 21, 2005 10:45 PM
Ok, I think I may understand what I was doing wrong and what I was missing.

In order to use the IAssetReferenceService for unbound recipes, I need to first explicitly create a recipe refernce (For unbound recipes the BindingRecipe is the place to do this), or this can also be done in a custom action.
KiddKane  Tuesday, June 21, 2005 3:41 PM
Ok I understand how to do this for Unbound references but how do I spawn recipes for bound recipes?

What is the assetname and target for these?
Also all the examples I seem to find that relate to this use vstemplates, are there any examples that use T3 templates?
KiddKane  Tuesday, June 21, 2005 8:40 PM
Bound references must be attached to a given target. You create a SolutionReference, SolutionFolderReference, ProjectReference or ProjectItemReference pointing to a given recipe. Then, you hand that reference over to the IAssetReferenceService. All these reference classes exist in the Microsoft.Practices.RecipeFramework.VisualStudio.dll assembly.

The constructor for those classes receive the concrete item being pointed (the target), so you will need to locate it first. For that, you can use the DteHelper.FindXXByPath, which receives the "virtual path" to the target. The "virtual path" is the path representation relative to the solution root in the Solution Explorer.

With those two pieces, you are all set to store a bound reference in the IAssetReferenceService and have the recipe appear in the designated target context menu (as well as the task list).
kzu  Tuesday, June 21, 2005 10:45 PM

You can use google to search for other answers

Custom Search

More Threads

• Error in running setup
• SharePoint recipe problems
• Not being shown the GAX screen to select '08
• Workaround for the UnfoldTemplateAction and parameter replacements
• Unable to install GAX June CTP - States Visual Studio 8.0 is not installed
• Bug in Loading Packages created with GAT June 2006
• Retreive Project location
• Cannot create WizardPage , Constructor on type ... not found
• Um, does anyone at Microsoft care or support GAT?
• Microsoft.VisualStudio.TextTemplating 8.2