views:

350

answers:

2

My company has several class libraries we use in multiple website projects (not web application projects). Website projects don't have .sln files, but I'm sure I've read in my past research that you can make a blank solution and put your website and class library projects in it.

After answers to my previous questions, this is the direction that I'm going (based slightly on http://amadiere.com/blog/2009/06/multiple-subversion-projects-in-one-visual-studio-solution-using-svnexternals/):

/websites
    /website1
        /trunk
            /website1
/libraries
    /library1
        /trunk
            /library1
    /library2
        /trunk
            /library2
    /etc...

Then I planed on using svn:externals to copy /library1, /library2, and so on into the working_copy/websites/website1/ folder.

I want my team members to be able to checkout the /trunk folder for website1 and get a .sln file, /library1 external, /library2 external, etc. I want that .sln file to contain the website1 website project, and all of the library external projects. Hopefully that would look something like:

/working_copy
    /websites
        /website1
            /trunk
                /website1
                /library1 (svn:external of libraries/library1/trunk/library1) 
                /library2 (svn:external of libraries/library2/trunk/library2)
                /etc.
                website1.sln

So, at the end of all of this, the goal is that my teammates check out the trunk, open the solution, and everyone has the exact same solution. When we commit, everything is committed appropriately to subversion (the website code, and the libraries are committed to their appropriate place on the repo).

How have others solved these issues? How can I make a .sln file that my team members and I can share in this manner?

+1  A: 

I think your approach about svn code and solution file structure is the right one. Also it is a good idea to use svn:externals as you described.

To create blank solution just select File->New->Project and choose Other Project Types->Visual Studio Solutions->Blank Solution. After you created it you can add new or existing projects to it using menu File->Add.

Andrew Bezzub
One minor problem in my "proof of concept" on this is that all of our working copies will have to have the same file structure since the website project has the file path from the client machine on it...it's absolute, not relative. Is this correct?
JustinP8
@JustinP8: I'm not sure I understand you - all working copies will have the same file structure - the same as structure in svn repository. What path do you mean in "website project has the file path from the client machine on it"?
Andrew Bezzub
@Andrew: What I meant was that I think all developers will have to set up their working copy in the same directory of their machines (i.e. C:\WorkingCopy) because visual studio uses absolute file paths in the project properties. Ultimately, I want to know how we can all share a .sln file containing the same website and class library projects on the subversion repo.
JustinP8
+1  A: 

It's a bad idea to put the library projects into the same solution as the web site project. Leave them in their own solution. In the web site project, right-click the project in solution explorer and choose "Add Reference". point to where you saved off the built library code (maybe on a file share).

John Saunders
I don't agree. It depends on how often "library" projects need to be modified and how close are they to the site being developed.
Andrew Bezzub
@Andrew: didn't he say the library projects were used in multiple web sites?
John Saunders
@John Saunders: now I got your point. I was meaning a bit another thing - I now have solution with two websites and several class libraries and it is quite convenient becase all of the projects are developing quite rapidly.
Andrew Bezzub
@Andrew: that's a good structure while your projects are being rapidly developed. It can be an issue with solution structure because the libraries really want to be in a different part of the source control tree than the web sites. Some source control/build systems like all projects in a solution to be under the solution directory, which is not where you want these files long-term. The OP may have a different scenario entirely, though. His library code may be stable.
John Saunders
JustinP8