tag:blogger.com,1999:blog-15136575.post115763027023442771..comments2023-10-17T12:00:16.772+01:00Comments on Code rant: Fustrating Visual Studio TemplatesMike Hadlowhttp://www.blogger.com/profile/16441901713967254504noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-15136575.post-78788349585439459842008-05-30T09:15:00.000+01:002008-05-30T09:15:00.000+01:00@Dan: You can cast the automationObject to _DTE fr...@Dan: You can cast the automationObject to _DTE from the RunStarted method.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-15136575.post-76711405994590081232008-05-13T18:12:00.000+01:002008-05-13T18:12:00.000+01:00Hello group, I have a sticky Multi-Project Templat...Hello group, I have a sticky Multi-Project Template (MPT) problem I'm sure many others are having. I need to parameterize individual projects in a MPT; I want to substitute various custom parameters (like Namespace names in code), but it only seems to work for SPTs.<BR/><BR/>I've found that you can add the "CustomParameters" element to a MPT VSTEMPLATE file, but that's it. These parms don't make it into the "RunStarted.replacementsDictionary" (which they do in a SPT), and when added to the Dictionary via Wizard code in "RunStarted", they aren't substituted in any of the projects i nan MPT Wizard as they are in a SPT Wizard. <BR/><BR/>It appears that the problem is, certain Wizard functions aren't called during the execution for an MPT. More accurately, it appears that there aren't "escapes" by VS into your Wizard at t ehdesired moments, so for example, the end of the entire solution generation is only when "ProjectFinishedGenerating" is entered for example, and then the "Project" type passed in is null. Seems like the "events" (in this case methods) are not fired for each successive project in an MPT.<BR/><BR/>Is there a way to circumvent this problem, is a fix coming (perhaps with more events and better control for MPTs), or is there a way to tap into the VS SDK during template generation? <BR/><BR/> <BR/><BR/>It'd also be cool if there was a way to open a CSPROJ file, edit it, and replace what was deployed by the Wizard/VS (w/out VS giving you the "this thing was changed outside the env; reload?" msg); at least I could make necessary changes in the CSPROJ files themselves. Again, this is probably something that having more "call-ins" at strategic points by Visual Studio during the generation might fix.<BR/><BR/>Anyway thanks in advance!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-15136575.post-19185338922256417672008-03-19T20:22:00.000+00:002008-03-19T20:22:00.000+00:00Where do you get the dte object from? when you imp...Where do you get the dte object from? when you implement the IWizard class, it doesn't seem like you can get the dte object to use Solution.SaveAs(...);Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-15136575.post-15445524785604281482008-02-21T10:13:00.000+00:002008-02-21T10:13:00.000+00:00Manuel,Thanks for the tip!MikeManuel,<BR/><BR/>Thanks for the tip!<BR/><BR/>MikeMike Hadlowhttps://www.blogger.com/profile/16441901713967254504noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-272826359400968542008-02-21T09:51:00.000+00:002008-02-21T09:51:00.000+00:00Found a nice workaround as a post processing step ...Found a nice workaround as a post processing step with the WizardExtension/IWizard combination:<BR/>* In the projects I modify the replacementsDictionary["$safeprojectname$"] in the RunStarted to solve the namespace issue.<BR/>* I save the solution on the correct location via dte.Solution.SaveAs in the RunFinished.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-15136575.post-49072722425729520292007-06-15T15:23:00.000+01:002007-06-15T15:23:00.000+01:00After digging several days into the multi-project ...After digging several days into the multi-project template, I discovered exactly the same things... There seems to be no way of setting the default namespace of the projects in your template-solution, and it seems impossible to alter the weird directory structure...Anonymousnoreply@blogger.com