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.”

Published 15 January 04 04:35 by KorbyP

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Simon T said on January 16, 2004 4:30 AM:
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 ?

# Darrell said on January 16, 2004 7:01 AM:
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.
# Scott McCulloch said on January 23, 2004 7:35 PM:
# Korby Parnell's WebLog said on April 19, 2004 3:41 PM:
# chris said on April 25, 2006 2:38 PM:
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.
# teen lesbian rape said on June 20, 2006 2:48 PM:
Persone los pioneros non rabata. Great...
# lesbian rape said on June 22, 2006 6:42 PM:
Best of all people w can talk...
# rape videos said on July 4, 2006 6:57 PM:
Your article is quite right, thanks.
# fixed mortgage said on August 26, 2006 3:29 PM:
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]
# malaga airport car hire said on September 2, 2006 6:49 AM:
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]
# asset management system said on September 3, 2006 5:05 AM:
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]
# fixed mortgage rate said on September 5, 2006 2:47 AM:
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]
# house insurance said on September 6, 2006 1:34 PM:
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]
# apply online for credit card said on September 7, 2006 6:22 AM:
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]
# business card credit said on September 15, 2006 3:28 PM:
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]

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required

Search

This Blog

Syndication

Page view tracker