Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > Change the solution path
 

Change the solution path

I've started to use GAT\GAX just recently in order to develop a guidance package to automate the solution layout just the way I like it.

I want the following structure for my solution:

  • Folder with the name equal to the SolutionName
    o "Trunk"
      • SolutionName.sln
      • SolutionFolders

I've already managed to put the .sln inside the "Trunk" folder using a custom action. I want that the creation of this folder to be transparent to the one using the guidance package. It does something like this:

Code Snippet

newDir = Path.Combine(originalSolutionDir, _trunkFolderName);
newFilename = Path.Combine(newDir, Path.GetFileName(originalSolutionPath));

Directory.CreateDirectory(newDir);

vs.Solution.SaveAs(newFilename);

Where the newFilename already has the folder "Trunk" in the path. But when in the template I do this:

Code Snippet
<TemplateContent>
<ProjectCollection>
<SolutionFolder Name="Source" />
<SolutionFolder Name="Tests" />
</ProjectCollection>
</TemplateContent>

All the solution folders are created under the original folder (the one with the name equal to the solution name) and not under the "Trunk" folder.

Does anyone know how to fix this?

Rodrigo Guerreiro  Thursday, January 24, 2008 5:24 PM

Rodrigo,

You can also create the solution folders in code [more control]and remove them fromthe projectcollection element in your vstemplate.

Clemens

Clemens Reijnen  Saturday, January 26, 2008 9:54 AM
Hi Rodrigo, what about creating the trunk sln folder in the template too?

<ProjectCollection>
<SolutionFolder Name="Trunk">
<SolutionFolder Name="Source"/>
<SolutionFolder Name="Tests"/>
</SolutionFolder>
</ProjectCollection>

HTH,
-Adrian
Adrian Alonso  Thursday, January 24, 2008 5:33 PM

Adrian,

That'sno good, because the "Trunk" folder is in a upper level than the solution file (.sln) and I want everything inside that "Trunk" folder. But thanks anyway Smile

Rodrigo Guerreiro  Thursday, January 24, 2008 6:25 PM

Rodrigo,

You can also create the solution folders in code [more control]and remove them fromthe projectcollection element in your vstemplate.

Clemens

Clemens Reijnen  Saturday, January 26, 2008 9:54 AM

You can use google to search for other answers

Custom Search

More Threads

• Some doubts about EnvDTE
• Is GAT dead?
• Clarius SFT June 2007 CTP available: GAX & DSL integration just got better!
• Modify WCF Guidance Package
• Automated Testing
• GAX/GAT: February 2008 Final Release
• The following arguments are required and don't have values
• What happened to the GAT/GAX downloads?
• Thrown exception does not trigger Undo in an action
• Text Templates And Existing Files