IFIX: Create Solution Skeleton File

DownloadIFix 1.7

When I start creating a new solution I normally want this in its own git repository, and I catch myself adding the same stuff over and over again.   And, I often get the folder structures wrong,  I seem to never get the hang of when and where Visual Studio creates a folder for the solution, why the solution ends up at the same place as the first csproj file, and I often end up moving things around to get it the way I want it.

The structure I prefer is to have the solution file at the root of the repository, and I want the standard .gitignore and .gitattributes files there, and also a readme.md.  The readme.md should contain information for the next developer (or myself a few months down the road).  The .gitignore should be the standard latest .gitignore from the github repository (no, not the one coming with Visual Studio, that one is older), and I want these files added as solution items to my solution.

Further, I want a default runsettings file there, which includes the settings for running tests in parallel.  I know I can download the item templates for that, or copy the content from somewhere on the web, but why not do this the easy way.

It should look something like this:

image

And opening the solution in Visual Studio should then show something like this:

image

The .gitignore and .gitattributes are also available from the git settings menu in the Team Explorer, but I always find it faster and more visible to see them in the solution, and – they do absolutely no harm being there.

When you add projects to the solution now, they will add themselves nicely as subfolders, exactly the way it should be.

How to

Using the command line to do things are very fast, so instead of  doing this from Visual Studio (where there are multiple ways of doing this, all with slightly different results), I added this as a separate command to the IFix program,  in version 1.7.  Using the command line have the added benefit of giving you even more control over how your file and folder structure ends up. 

The commands to create the repository and the  solution file is:

image

1) Create the folder for the repository

2) Create the git repository:   git init

3) Create the solution file:   IFix createsln fantasticApp –f

IFix syntax

The syntax for creating the solution using IFix is:

IFix  createsln  <your solution name>  -f

The solution name don’t need to include the “.sln”, that is added automatically.

If you want a completely blank solution,  you can add the option –blank, and the skeleton will not contain any files.

About terje

See http://about.me/terjes