Question

I have a multi-project Visual Studio project template. I want to be able to, conditionally, exclude specific projects from the created solution.

I've looked into the ProjectFinishedGenerating method of my IWizard implementation, but I can't seem to figure out how to simply ignore a project.

So, essentially I want to do something like this pseudo-code in my IWizard implementation for projects:

public void ProjectFinishedGenerating(Project project)
{
   if(ExcludeAcmeProject && project.Name=="Acme"))
   {
      project.Cancel();
   }
}
Was it helpful?

Solution

I figured it out. I can look at the customParams parameter in the RunStarted method (it contains the path of the .vstemplate file) and throw a WizardCancelledException if I want to skip that specific project.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top