1

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();
   }
}
Ted Nyberg
  • 7,001
  • 7
  • 41
  • 72
  • I've tried the **Delete()** method, but it throws a **NotImplementedException**... :/ – Ted Nyberg Dec 01 '11 at 10:10
  • I think 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**. – Ted Nyberg Dec 01 '11 at 10:19

1 Answers1

2

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.

Ted Nyberg
  • 7,001
  • 7
  • 41
  • 72
  • Hello, Can you help me with this requirement? https://stackoverflow.com/questions/60220136/how-to-add-conditions-in-visual-studio-template-schema-and-generate-projects-bas – Deepak Kothari Feb 18 '20 at 23:38