Monday, January 10, 2011

Multiple Solutions with the Same Structure - Visual Studio 2010 How To

Duplicating Solutions in Visual Studio 2010.

As you probably know, I work in a company that provides sports betting solutions for many companies.  Each company has its own GUI and sometimes different flows inside the site.

This is basically not hard to manage as long as you create a proper Skeleton Solution.

A Skeleton Solution is a solution contains only the most relevant files and folders.  The same classes and JavaScript files that exist in every other solution.
A Skeleton Solution will contain, in most of the times, several projects.

I believe you've read my article about File Sharing in VS 2010.
This article is in some way an extension of the one I just mentioned.

How to Create a Skeleton Solution from an Existing Solution:
It's even easier then you think.
  1. Create a folder named: "Base Solution" or "Skeleton Solution".
  2. Copy the content of your existing solution's folder.
  3. Paste the content inside your Skeleton Solution's folder.
  4. Change the names of:
    1. ".sln" file to "Skeleton.sln"
    2. ".vssscc" file to "Skeleton.vssscc"
    3. You can delete the ".sue" file.
You now have a working copy solution of your existing one.
Now you have to make it a truly Base Solution:
  1. From the Skeleton Solution, delete the files you intend to share.
  2. Now add them from your existing solution "as Linked Files".
That's it.
Your Skeleton Solution is ready. Every solution you will create from it will have the same files and projects is the Skeleton Solution.

More over...
The copied solutions will also have the same linked files as the Skeleton Solution in the exact same format.

This method will save you lots of precious time and even more important - will save you potential errors.

Thanks,
Elad Shalom,
CTO at ITweetLive.com

5 comments: