Visual Studio multi-project templates rename namespaces and project names

后端 未结 1 1279
醉酒成梦
醉酒成梦 2021-02-06 07:12

I\'ve successfully created a multi-project solution template. What I would like to do, however, is to rename the beginning of each project with the name of the solution.

1条回答
  •  猫巷女王i
    2021-02-06 08:00

    If your main .vstemplate (the solution's one) is like the example below, you can use variables defined in wizard's dictionary to rename project folders and .csproj to whatever names you want.

    
    
        
            My Web Server Solution with DAL
            Creates Projects for Web Server DAL and adds them to a new or existing solution
            
            CSharp
            My
            WebServer
            2
            My
            My.Dal.Web.Template
        
        
            
                
                    Children\Model\ProjectTemplate.vstemplate
                
                
                    Children\SharedModelContracts\ProjectTemplate.vstemplate
                
                
                    Children\RepositoryInterfaces\ProjectTemplate.vstemplate
                
                
                    Children\RepositoryImplementation\ProjectTemplate.vstemplate
                
                
                    Children\RepositoryExtensions\ProjectTemplate.vstemplate
                
            
        
        
            My.WebServerDalExtension.Wizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5c93c79b0feae916
            My.WebServerDalExtension.Wizard.Controller
        
    
    

    Use similar changes to addition .vstemplates (the projects' .vstemplates) to rename the .csproj files.

    0 讨论(0)
提交回复
热议问题