none
Adding a project to Folder in a Visual Studio Template

    Question

  • I have created a multi project Visual Studio Template following these instructions:

    http://msdn.microsoft.com/en-us/library/ms185308.aspx.

    This works fine and I can see my two projects in Visual Studio when I select my project template from the File-->New Project option.

    I have followed this link http://msdn.microsoft.com/en-us/library/ms185301.aspx and I am able to add new folders to my solution by doing the following in the CustomWizard.

    public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
     {     
         _dte = automationObject as _DTE;
     }
    
     public void RunFinished()
     {
         _solution = (Solution2)_dte.Solution;
     
         _solution.AddSolutionFolder("MyFolder1");
         _solution.AddSolutionFolder("MyFolder2");    
     }

    But I want to add a certain project that is in my template under MyFolder1 and add another project that is in my template under MyFolder2.

    At present with the above code my projects will be loaded from the template AND there will be 2 folders created beside them.  I want the projects under the folders.

    How can I do this??

    Thanks for any help you can give :)


    Thursday, May 01, 2014 8:17 AM

Answers