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.
Use the start window Open Visual Studio. On the start window, select Clone a repository. Enter or type the repository location, and then select the Clone button. You might be asked for your user sign-in information in the Git User Information dialog box.
C# | Clone() Method In C#, Clone() is a String method. It is used to clone the string object, which returns another copy of that data. In other words, it returns a reference to this instance of String. The return value will be only another view of the same data.
You can open code into Visual Studio in the following ways: On the Visual Studio menu bar, choose File > Open > Folder, and then browse to the code location. On the context (right-click) menu of a folder containing code, choose the Open in Visual Studio command. Choose the Open Folder link on the start window.
I have created a small application for this. It works just like the previously mentioned Solutionclone app, except that it is both a command line application as well as a WPF application.
Cloney copies a source folder to a target one, without any Git or Svn integration. It will also replace the old namespace everywhere (in file names as well as within files) with the new namespace (the name of the target folder) and exclude certain files (e.g. *.suo, *.user, *.vssscc) and folders (e.g. .git, .svn).
You can grab the source code or download an executable at https://github.com/danielsaidi/cloney.
Cloney can also be added to the Windows Explorer context menu, which makes it possible to clone .NET solutions by just right-clicking the .sln file.
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
Look at Tree Surgeon on CodePlex, it creates a development tree for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With