locked
Multi Project Template: Rename project folder RRS feed

  • Question

  • Hi,

    I have created a project template which includes multiple other templates, so that the wizard can create multiple projects at once.

    The structure looks like this:

    <VSTemplate Version="3.0.0" Type="ProjectGroup" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
    	<TemplateData>
    		<Name>Modul Template</Name>
    		<Description>Modul Template</Description>
    		<ProjectType>CSharp</ProjectType>
    		<ProjectSubType>
    		</ProjectSubType>
    		<SortOrder>1000</SortOrder>
    		<CreateNewFolder>true</CreateNewFolder>
    		<DefaultName>Name with Namespace</DefaultName>
    		<ProvideDefaultName>false</ProvideDefaultName>
    		<LocationField>Enabled</LocationField>
    		<EnableLocationBrowseButton>true</EnableLocationBrowseButton>
    		<Icon>logo.png</Icon>
    	</TemplateData>
    	<TemplateContent>
    		<ProjectCollection>
    			<SolutionFolder Name="$projectname$">
    				<ProjectTemplateLink ProjectName="$projectname$.Interface">
    					x.Interface\MyTemplate.vstemplate
    				</ProjectTemplateLink>
    				<ProjectTemplateLink ProjectName="$projectname$.MsSqlProvider">
    					x.MsSqlProvider\MyTemplate.vstemplate
    				</ProjectTemplateLink>
    				<ProjectTemplateLink ProjectName="$projectname$.Provider.Test">
    					x.Provider.Test\MyTemplate.vstemplate
    				</ProjectTemplateLink>
    				<ProjectTemplateLink ProjectName="$projectname$.Provider">
    					x.Provider\MyTemplate.vstemplate
    				</ProjectTemplateLink>
    				<ProjectTemplateLink ProjectName="$projectname$.Service.Tests">
    					x.Service.Tests\MyTemplate.vstemplate
    				</ProjectTemplateLink>
    				<ProjectTemplateLink ProjectName="$projectname$.Service">
    					x.Service\MyTemplate.vstemplate
    				</ProjectTemplateLink>
    			</SolutionFolder>
    		</ProjectCollection>
    	</TemplateContent>
    	<WizardExtension>
    		<Assembly>MyWizard, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=7382bc267c5ab762</Assembly>
    		<FullClassName>MyWizard.IWizardImplementation</FullClassName>
    	</WizardExtension>
    </VSTemplate>

    I want to create projects that have the namespace in it as well, so a project might be called com.test.core.module1.

    When I start the wizard, it creates the following projects:

    com.test.core.module1.Interface
    com.test.core.module1.MsSqlProvider

    etc.

    The problem is, that the project folder name also contains com.test.core.module1. which is against the company policy.

    Is it somehow possible to only create folders, that contain the last portion of the module name?

    e.g.:

    Interface (folder name), com.test.core.module1.Interface (Module name and namespace)

    • Moved by Jiayi Li Friday, September 11, 2015 2:43 AM
    Thursday, September 10, 2015 2:55 PM

Answers

All replies

  • Hi TheGrudge_2,

    This forum is about Visual Studio IDE, your issue is related to multi project template, it would be related to Visual Studio Integrate, I help you move this case to Visual Studio Integrate forum for dedicated support.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click HERE to participate the survey.

    Friday, September 11, 2015 2:41 AM
  • Hi TheGrudge_2,

    According to your description, you could use Folder Element  to create folder in project. Code below is for your reference.

    <Folder Name="Project Folder">
        <Folder> ... </Folder>
        <ProjectItem> ... </ProjectItem>
    </Folder>

    For more information, link below is for your reference.
    https://msdn.microsoft.com/en-us/library/ahkztdcb.aspx?f=255&MSPPError=-2147217396

    Best Regards,
    Li Wang

    • Marked as answer by DotNet Wang Wednesday, September 30, 2015 8:15 AM
    Tuesday, September 15, 2015 8:15 AM