问题
I created a project template in Visual Studio 2010. When I click on Project -> File -> Export Template, I get a zip file in the Visual Studio template folder. In the solution, I have a folder named Test.
When I create a solution from that template (from add -> new project dialog), I want to rename the Test folder's name to the solution's name automatically.
How can I do that?
回答1:
- Get the files out of the zip file
- In "MyTemplate.vstemplate", change
TargetFolderName="Test"toTargetFolderName="$projectname$" - In the .csproj file, change everything that refers to folder "Test" to "$projectname$" (including paths, etc.)
This should work.
Additional info:
https://msdn.microsoft.com/en-us/library/ahkztdcb.aspx (Visual Studio project template info) https://msdn.microsoft.com/en-us/library/eehb4faa.aspx (Visual Studio template macros reference)
来源:https://stackoverflow.com/questions/9190741/how-rename-a-folder-inside-project-template-to-projects-name-visual-studio-te