Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how rename a folder inside project template to project's name? (visual studio template customization)

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?

like image 873
SilverLight Avatar asked Feb 08 '12 09:02

SilverLight


People also ask

How do I Rename an entire project in Visual Studio?

Visual Studio is not competent at renaming things. Open the project folder in any good text editor. Search-and-replace across the whole folder and replace and text occurrences of the old name with the new name. Sublime Text and Atom have a tree view where you can right click -> Search in folder.


1 Answers

  1. Get the files out of the zip file
  2. In "MyTemplate.vstemplate", change TargetFolderName="Test" to TargetFolderName="$projectname$"
  3. 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)

like image 191
Overlord Zurg Avatar answered Sep 22 '22 02:09

Overlord Zurg