Converting IDTWizard to GAT project and solution templates.

I'm trying to convert our existing project templates into GAT. Unfortunately my GAT doesn't let me do some things and does too many things for me in other cases.

First, let's throw away the Visual Studio text replacement stuff everywhere and use the "T3" stuff. I previously complained about this for project items and somebody replied that I might be able to do that in the next release of GAT. Does this also apply to project templates?

Second, the Action is only ran AFTER the project has been created. There is no way that I can see to get in before the project is built.

Third, I can't disable the project Name and Location. My wizard is responsible for gathering the name and location from information it gathers. For example, all "customization" projects must be in the customization projects directory. The only thing I can do now is check to see where the project landed and tell them they are going to have problems.

What I really want: I would love to be able use the *.vstemplate file to specify a different class in the <WizardExtension> element. If you would supply a class that just calls my recipe. All the stuff in IDTWizard.Execute could be arguments in the recipe. If you guys would do this then I could take my current IDTWizard and just move it over to one or multiple actions in my recipe.

[1330 byte] By [JLeBert] at [2008-1-28]
# 1
1 - I'll let Oscar answer this one. He implemented the T4 (successor of T3 in the next release) integration with .vstemplates.
2 - Actions usually modify the environment, or generate data for subsequent actions to use. There's not much point in executing actions when there's nothing new in the solution yet. Maybe you can clarify your requirements and why you think you might need that. The current behavior is by design.
3 - I'll let Oscar take over too ;)
You say: "If you would supply a class that just calls my recipe."
That's exactly what our extension does. But it offers you the argument gathering prior to unfolding the templates, and actions execution after that. Again, I fail to see why that's not appropriate for your scenario (which I ignore ;)).

HTH
/kzu
kzu at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Guidance Automation Toolkit...
# 2

1. In the next release of GAT you will get the T4 text templating engine integrated with the VS templating engine. No more use of the T3 Action. Basically you will be able to use all the Recipe arguments in the T4 template, and you can optionally add actions.

3. If I understand correclty, you resolve your issue by creating and unbound reference to your template and only enable the template when the user is activating it from the correct location. Then you can use the current location and project name as recipe arguments in your template.
Let me know if this does not address your problem.

OscarCalvo at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Guidance Automation Toolkit...
# 3
1. I love the T3 stuff so T4 must be better! Looking forward to it!

2. This wasn't too important. I was just trying to work around for #3.

3. I haven't been able to resolve my issue. Maybe I'm missing something. I'm talking about projects not project items and as far as I know they always show up. Start Visual Studio, select File/New/Project..., find your package under Guidance Packages and you will see the project templates you have. I don't think bound or unbound references come into this at all.

What I need is to disable the Name and Location fields on the New Project dialog. This can be done in the *.vsdir you guys file you guys are creating in the Projects.Cache directory. As far as I can tell you are always setting the Flags to 80. If you add in 32 (VSDIRFLAG_DisableLocationField) and 8192 (VSDIRFLAG_DisableNameFlag) you could disable the two controls I'm talking about.

I need to do this because need to gather my information and then set the project name and project directory based on that information. This is why I brought up #2.

I tried to work around this be setting the $destinationdirectory$ value but it wouldn't let me. I could get the value, just not set it.

JLeBert at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Guidance Automation Toolkit...
# 4
3. The project templates that you deploy in the Templates\Solutions folder are considered starting points for your package, and therefore will always appear on the Add New dialog. Project templates that you include in the Templates\Projects folder of your package will only appear if there is a reference (bound or unbound) to them in the current context/selection.
As for disabling the fields, I guess we could evaluate adding an option for allowing it. However, I'm wondering how/if that complicates matters WRT handling absense of those required values at the time the actual unfolding is performed...
Also, I'm wondering that if you cannot set the destination directory right now, what would change if you disable the fields....
kzu at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Guidance Automation Toolkit...
# 5
My projects are in the Templates\Solutions folder. I always want them available so everything is good.

Obviously disabling the fields causes problems if my code doesn't fill in the values. I was implying that I should be able to disable the fields and be able to set their values. If my code didn't fill in the values then I would expect GAT to throw an exception. All in all, not to much work. (I love it when people tell me a feature is easy when they don't know anything about it. Its much more fun from the ignorant side!)

OK, instead of me trying to say how to fix the problem maybe I should say again what my problem is. I need to be able to set the destination directory of the project being created and would like to be able to set the project name also. Having the fields enabled would really confuse things. My wizard collects the information that is needed to determine the destination directory and project name and would fill them in appropriately.

My other idea was to allow my guidance package to take over the wizard process completly. Basically just have GAT call my action's Execute pretty much directly from IDTWizard.Execute. This would allow complete flexibility. Remember, whenever you make something easier by providing a framework you still need to allow people to bypass what you've done.

JLeBert at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Guidance Automation Toolkit...
# 6

I think you could create your own .vsdir and .vsz files for your wizard.
Create a folder called "Templates\Projects.cache" and place your .vsdir and .vsz file there.
You can modify the behavior of the Add New dialog box by specifing a flag in the .vsz file. Also, you can specify the same guid of the GAT IDTWizard or the guid of your own IDTWizard. Check the MSDN docs and how to build your .vsz file.
If your template is not visible , then try to manullay register your .vsz/.vsdir files and place them into a new folder in the Templates folder of your GAT package.
I don't know if this is going to work, try it and let me know.

OscarCalvo at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Guidance Automation Toolkit...
# 7
That sounds like it will work. I don't like having to do a "huge" amount of work and bypass most of the GAT stuff. It seems like a simple addition that might be needed by others. It's part of Visual Studio templates so I'm sure somebody thought it was a good idea. I humbly ask that you consider adding the feature.

I REALLY want to use GAT, but the more things I have work around GAT for, the bigger the chance I just give up and go back to a standard Visual Studio package.

JLeBert at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Guidance Automation Toolkit...
# 8
I've just added a feature request for this. Will make our best to get it before RTM.
Thanks for your feedback!
kzu at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Guidance Automation Toolkit...
# 9
This would be a life saver. I've spent the first half of the day trying to figure out how to keep using GAT and working around this issue. I will put off worrying about this for a little while longer and hope it all works out!

I assume you will just put the ContextParams[] into the arguments collection so I can actually fill in the correct values. Also I believe there is a flag to disable the Browse button on the form too. It would make sense to be able to turn that on/off.

3000 thanks in advance!

JLeBert at 2007-9-9 > top of Msdn Tech,Visual Studio,Visual Studio Guidance Automation Toolkit...

Visual Studio

Site Classified