How to tell the new project wizard not to create project folder RRS feed

  • Question

  • Hi,
    I create a new project type and I am using a project template.  Right now if in the new project wizard I specify name "MyProject" and Location "[Path]" the project template gets create in [Path]\MyProject\MyProject.projectExt. What code do I have to change to  tell the wizard to create [Path]MyProject.projectExt instead? (Ie. not create a project folder)
    Tuesday, April 28, 2009 9:05 PM


  • Hello,

    If I understand you correct, you want your template items to be placed in the specified directory without creating a new folder for it.  If so, there is a tag "CreateNewFolder" for this requirement.

    But please be awared: This is to deal with issues with different project systems.
    • VB is a folder based system and gets confused when you create a new project in an existing folder with items already there (even if they don't collide).
    • C++ is NOT a folder based project system and can deal with this situation just fine.
    • CreateNewFolder is a project level requirement for some project systems.  A project system can require a new folder.  In this case, the CreateNewFolder value is ignored.  If a project system does NOT require a new folder, the VsTemplate can specify the value.  Basically the project system can override the value to TRUE.
    • Managed project systems (C#, J# and VB) all require a new folder. So setting the value to FALSE in the VsTemplate will have no effect.

    More information about the Visual Studio Template Schema Reference: http://msdn.microsoft.com/en-us/library/xwkxbww4.aspx

    And you could add a registry value "NewProjectRequiresNewFolder(VsTemplate)" under your custom project and set it to 0.

    Wesley Yao

    Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Wesley Yao Tuesday, May 5, 2009 2:19 AM
    Thursday, April 30, 2009 9:53 AM