Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > How to add an assembly reference when processing an item template?
 

How to add an assembly reference when processing an item template?

Hi,

I have an item template that uses a base class in another assembly. Is there a way to ensure the project has a reference to that assembly and if not, add it when processing the template?

Regards,
Alexander

AlexanderJ  Friday, October 13, 2006 7:25 AM

Actually, I was referring to the declaratively way.

If you take a look at the solution template generated by GAT you will notice something like:

<WizardData>

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

SchemaVersion="1.0"

Recipe="YourRecipeName">

This will cause the firing of the YourRecipeName when the template is unfolded.

vga  Thursday, October 19, 2006 5:09 PM
I see your point. This is not supported by Visual Studio templates. And as you mention is a really common thing one may want to do, I've submitted a suggestion to the product group for adding this a couple of month ago (when I first encounter it and had to resolve to an action for doing this).
vga  Monday, November 13, 2006 5:02 AM

You could make your item template fire a recipe when unfoldedand have this recipe contain an action that creates a project reference. Did you try this approach?

-Victor.

vga  Wednesday, October 18, 2006 4:47 AM

That is the obvious way. I rather hoped that there is some way to do it declaratively within the remplate file....

Thanks anyway.

AlexanderJ  Wednesday, October 18, 2006 5:22 AM

Actually, I was referring to the declaratively way.

If you take a look at the solution template generated by GAT you will notice something like:

<WizardData>

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

SchemaVersion="1.0"

Recipe="YourRecipeName">

This will cause the firing of the YourRecipeName when the template is unfolded.

vga  Thursday, October 19, 2006 5:09 PM

Well, the idea was to have some kind of declaration (probably within the tempate) stating what assembly references the template needs. And the engine careing for the reference in the project.

I know how to do that in a custom action, yet it strucks me as a very common demand that should be available within the system.

Regards,
Alexander

AlexanderJ  Wednesday, October 25, 2006 5:29 AM
I see your point. This is not supported by Visual Studio templates. And as you mention is a really common thing one may want to do, I've submitted a suggestion to the product group for adding this a couple of month ago (when I first encounter it and had to resolve to an action for doing this).
vga  Monday, November 13, 2006 5:02 AM

You can use google to search for other answers

Custom Search

More Threads

• Trying to add a new class to the References folder...
• pre/post build events
• Installing GAT and GAX on Windows 2008 64bit
• no menu entry in VSS 08 for guidance automation packages
• CommandBars
• Update guidance already installed
• Assembly reference in .t4 file
• Adding a recipe to a GAT package to create a view/presenter as in SCSF
• Path of Bin Folder for a given project
• Clarius SFT June 2007 CTP released issues