It's generally a good rule to not blog about what you don't know, but sometimes it's a moral imperative. With my ignorance highlighted with a yellow marker, let me tell you about my Visual Studio Website Project Awakening, the week that was.
As I mentioned in a previous post, I created a web site for my sister during my latenight geek sessions this past week using Expression Web and BlogEngine.Net. I couldn't consider using a .NET application unless I had the source, so I fired up the BlogEngine.Net Visual Studio Solution to discover it's a Website Project, not the Web Application Project model that I've been using for, umm, ever.
99% of you know this, but for the 2 guys who don't, the Website Project model was somewhat of a disruptive innovation where we developers had to change our approach to compiling and deployment. It was like when Coca-Cola pulled Coke for New Coke in 1985 and after a few months of customer revolt re-released the original formula (our Web Application Project model) as Coke Classic. I was a fully-functional adult in 1985 (well, mostly, as I was living in the French Quarter at the time), so I can say that New Coke sucked. I can also say from what I learned this week about the Website Project Model that it is no New Coke.
I should have gotten the Website Project model a couple of years ago, but I never did. To my credit I was determined to gain understanding this past week. At the start of my Week of Awakening I used the "Publish Website" option to update my web site. I entered a destination. Visual Studio cranked and cranked, then prompted me with "All of the destination files will be deleted. Proceed?" What??? I just want to change an .ASCX.CS label ID, for goodness sake!
So I downloaded and got cozy with the Web Deployment Project. Cool. I was adding ExcludeFromBuild statements to the .wdproj and everything, but the principle was the same. Delete everything in the destination and recreate.
Okay, Scott Guthrie is the smartest guy in the room, so I knew I was definitely missing something. Surely he had good reasons for creating the VS2005 Website project model. I began reading everything I could google about ".NET Website Project advantages" and ".NET Website Project Deployment." I read Jim Duffy's intro to ASP.NET 2.0 Web Sites in Code Magazine, who referred me to Rick Strahl's excellent "Compilation and Deployment in ASP.NET 2.0" article. Then I entered my Web Project Deployment phase for a day or so until I sought The Master's Guidance. The sheep heard the voice of its shepherd in "VS 2005 Web Project System: What is it and why did we do it?"
"We also support an 'on demand' compilation workflow where a user can just save the code-behind or class file they are editing, and immediately hit refresh in the browser (no explicit re-compile or re-build required). ASP.NET will then on-demand re-compile only the changed resources and apply it to that request – allowing you to immediately see the difference."
- Scott Guthrie, August 21, 2005
I am Chauncey Gardner. "I understand." I am a Believer. I am on board. I am down for the Website Project Model. I get it. ScottGu can feel that after 3 years, his efforts are finally validated by Dave Burke. Sleep well tonight, Scott. You've earned it.