views:

744

answers:

5

Starting new .NET projects always involves a bit of work. You have to create the solution, add projects for different tiers (Domain, DAL, Web, Test), set up references, solution structure, copy javascript files, css templates and master pages etc etc.

What I'd like is an easy way of cloning any given solution.

If you use copy/paste, the problem is that you need to then go through renaming namespaces, assembly names, solution names, GUIDs etc.

Is there a way of automating this?

Something like this would be great:

solutionclone.exe --solution=c:\code\abc\template.sln --to=c:\code\xyz --newname=MySolution

I'm aware that Visual Studio has project templates, but I've not seen solution templates.

Ideas welcome, thanks in advance folks!

+2  A: 

As you already found out: Copy the .sln File and make sure the paths/guids match.

Because the .sln are text/plain just use your favourite scripting language to script a cloner.

Maybe this is a good time to learn Python/Ruby/Perl/Windows Script Host

MSDN Solution (.sln) File Definition

Andre Bossard
On windows? Powershell - seriously capable even before you start pulling .NET assemblies in to play with
Murph
A: 

I believe the Guidance Automation Toolkit allows you to do this, but may not be an "easy" way:

http://www.microsoft.com/downloads/details.aspx?familyid=B91066B3-D1D6-4990-A45F-34CF8DBDC60C&displaylang=en

I have the same problem as you and intend to look at it in detail "real soon now".

Joe
+1  A: 

Look at Tree Surgeon on CodePlex, it creates a development tree for you.

Stuart McConnell
A: 

Thanks for the replies guys. Sounds like there's nothing out of the box that will meet my needs.

Tree Surgeon doesn't seem to clone solutions, just generate them? GAT (which I believe is being replaced by a new project) doesn't support the "clone arbitrary solution in 10 seconds" use case, but is probably close.

@Joe, let me know if you get on to this. Otherwise I might tackle it myself (or get someone to do it for me!).

Tobin Harris
If you do tackle it, post back here - I'll do the same!
Joe
A: 

Hi,

May be you should check Warmup open source project. Find brief description on http://devlicious.com/blogs/rob_reynolds/archive/2010/02/01/warmup-getting-started.aspx.

IMHO, advantage of Warmup approach is that it can clone the whole tree with solution directly from SVN or GIT.

Note! I haven't use it personally, but plan to give it a try in the next project. Please leave a comment if you use it.

Andrej Golcov