Best Practices for Setting up Source-Controlled Solutions that Contain Web Projects
A customer recently hit me with the following question:
“When we set up our web projects, we mirror our file system view to our repository view using a virtual directory. Ex. file system - c:\Webproj_soln (this is our solution, under that would be our project c:\Webproj_soln\Webproj. This is where we would create our virtual directory, so it directly mirrors our repository. Is this still a best practice? I know some people just take the defaults and put everything under inetpub.”
My Response:
“You're doing it exactly right. Brief historical detour: in the first version of Visual Studio .NET, there was a bug that effectively prevented placement of source-controlled Web projects outside inetpub. I can't remember the details off the top of my head but I do know that the issue was resolved in a pre-Visual Studio .NET 2003 update. It's entirely possible that the folks who keep their Web projects in inetpub were conditioned to do so by this early bug.
Best practice? If you don't use source control, inetpub/wwwroot is fine. From a source control perspective however, it's really wise to organize your local copy of a solution in exactly the same way as the server version is organized in the repository. It therefore makes sense to save your solution to a non-inetpub directory and when enlisting in or adding a Web project to the solution, to create a virtual directory. I went into the reasons why this is a good idea in a blog post I wrote last year, Guidance on Creating Projects and Solutions.
For more details and best practices, see the Team Development Guide's Structuring Solutions and Projects chapter and Web Projects and Source Control Integration in Visual Studio .NET.”
Comments
- Anonymous
January 15, 2004
I have the same problem, in 1.1 we get the nice spangly solution.root option in Vss to place projects in but according to the docs I read unless your web projects are created in wwwroot$ then it will not auto create them.
Whilst I can pre-create the Virtual directory and point it at the corect directory mirroing the SS layout, why should I ? Your constantly fighting the default behaviour and there are no options, I am aware of, to alter this behaviour. This also causes problems when opening from the filesystem intead of Source code control as many a time it refuses to use My Virtual directory and tries to create another _1 version.
So am I missing something ? Is there an option to get VS.NET to create the project where I want instead of wwwroot$ or like I mentioned I have to predetermine the VD location ? - Anonymous
January 15, 2004
Simon, no there is no way. The best solution we came up with was to write a batch file that created the appropriate folders and virtual directories under a solution folder that you specify. It also downloaded the solution file. You ran the batch file. Then you double-clicked on the solution file and it downloaded the rest of the solution.
A definite kludge, and one reason why Fritz Onion and others liked to use class libraries instead of ASP.NET projects. In the Whidbey version, I believe you will be able to run an ASP.NET project without IIS installed at all, so you will no longer need to create virtual directories. - Anonymous
April 25, 2006
SourceSafe seems to be stuck in a rut. Is it being developed further or has it reached a point of maturity where no further development is necessary?
A nicer interface would be...nice. - Anonymous
June 20, 2006
Persone los pioneros non rabata. Great... - Anonymous
June 22, 2006
Best of all people w can talk... - Anonymous
July 04, 2006
Your article is quite right, thanks. - Anonymous
August 26, 2006
Thank you for this great post about <a href="http://eteamz.active.com/mailinglist/files/fixed-mortgage.html"">http://eteamz.active.com/mailinglist/files/fixed-mortgage.html" title="fixed mortgage">fixed mortgage</a> and [URL=http://eteamz.active.com/mailinglist/files/fixed-mortgage.html]fixed mortgage[/URL] - Anonymous
September 01, 2006
Thank you so much for this great post about <a href="http://eteamz.active.com/yourbusiness/files/malaga-airport-car-hire.html"">http://eteamz.active.com/yourbusiness/files/malaga-airport-car-hire.html" title="malaga airport car hire">malaga airport car hire</a> and [URL=http://eteamz.active.com/yourbusiness/files/malaga-airport-car-hire.html]malaga airport car hire[/URL] - Anonymous
September 02, 2006
Thanks for the great tips about <a href="http://eteamz.active.com/cashback/files/asset-management-system.html"">http://eteamz.active.com/cashback/files/asset-management-system.html" title="asset management system">asset management system</a> and [URL=http://eteamz.active.com/cashback/files/asset-management-system.html]asset management system[/URL] - Anonymous
September 04, 2006
Thanks for the great tips about <a href="http://companyfinance.50megs.com/fixed-mortgage-rate.html"">http://companyfinance.50megs.com/fixed-mortgage-rate.html" title="fixed mortgage rate">fixed mortgage rate</a> and [URL=http://companyfinance.50megs.com/fixed-mortgage-rate.html]fixed mortgage rate[/URL] - Anonymous
September 06, 2006
Thanks for the great tips about <a href="http://bingo.builtfree.org/house-insurance.html"">http://bingo.builtfree.org/house-insurance.html" title="house insurance">house insurance</a> and [URL=http://bingo.builtfree.org/house-insurance.html]house insurance[/URL] - Anonymous
September 06, 2006
Thanks for the great tips about <a href="http://RouletteFortune.bravehost.com/apply-online-for-credit-card.html"">http://RouletteFortune.bravehost.com/apply-online-for-credit-card.html" title="apply online for credit card">apply online for credit card</a> and [URL=http://RouletteFortune.bravehost.com/apply-online-for-credit-card.html]apply online for credit card[/URL] - Anonymous
September 15, 2006
Thanks for the great tips about <a href="http://autofinancing.builtfree.org/business-card-credit.html"">http://autofinancing.builtfree.org/business-card-credit.html" title="business card credit">business card credit</a> and [URL=http://autofinancing.builtfree.org/business-card-credit.html]business card credit[/URL]