Sunday, March 02, 2008

Web Application Project revisited

The most recent Sitecore project I was involved in, was quite a beast. Not in terms of the project itself, but how we had to cope to handle it in our daily working environment. The client had a handful of sites in the solution, all of them sharing functionality to some extent, and then each site had its own unique functionality bits as well. Now as I'm sure most anyone who's ever worked with Web Application Project in a VSS environment can imagine; a solution such as the one we had our hands on there, gets fairly big. And then imagine 2-3 separate teams working on the solution at the same time - getting exclusive access to the ever so central Project File becomes problematic in ways that most of all remind me of The Dining Philosophers. I am no fan of the Web Application Project, never have been and never will be. So I thrawled through SDN, just to see if there were any new developments in this area. I came across this one; VS2005 and Sitecore 5.3 setup without Web Application Project. Nice. I'll summarize what it says - basically it instructs you to move the "problematic" areas of your Sitecore solution outside your project scope (much like your /Data folder), and voila. I don't know though, and the article points this out as well... How will various modules and tools react to this somewhat dramatic change in structure? As I don't really have the time to test this out in any detail, I decided to just give something a shot. I pulled this tip off the web some time ago (I forgot where, sorry). If, as the SDN article states, the problem is isolated to two folders; "/App_Config" and "/Sitecore", there is a fairly quick and simple workaround that appears to be working - and is by far, less intrusive than moving the folders out of the directory structure entirely.
  1. Configure your explorer (not IE, your Windows Explorer) to "Show Hidden Files and Folders" (I won't post screenshots, as my current Vista installation is in Danish)
  2. Go to your root "/Website" directory for your solution. Mark the two folders; "App_Config" and "Sitecore", rightclick, and check the box "Hidden" (found right below readonly). It will ask you if this should apply to subitems as well, just say no to that.
  3. Fire up your favorite Visual Studio (I just tried this with Visual Studio Express 2008 and it worked fine), go "Open Website" (or "Open Website in Existing Folder", all depends a bit on what VS version you are using)

And there we go.

From here, I rightclicked the "Website root" and selected "Add ASP.NET Folder" -> "App_Code", tossed a few class files in there, made up a few references to this code from both .aspx pages and .ascx sublayouts... it all ran fine, and I never needed to manually compile (ah, the good old CTRL-SHIFT-B) once.

Does this qualify as conclusive evidence this will work? Absolutely not. But if the method of moving the folders out is "under evaluation", maybe this should be as well? Seems to me to be very straightforward.

I'll work with it for a while, see if I bump into any unexpected mishaps.