Tuesday, June 21, 2005

ASP Apps Without Web Projects

I've just started working with Web applications in VS.NET 2003. One big gripe: I hate the mess with Virtual Directories scattering files all over the place. Thank goodness I picked up a copy of Expert .NET Delivery Using NAnt and CruiseControl.NET by Marc Holmes. I found a gem of a reference tucked in all the other great info in the book: Swapping Web Projects for Class Libraries. None other than Fritz Onion has a Wiki site explaining the steps involved. He also gives a bit of background on why he does web apps this way. Fritz's hack I mean trick gives you the web component wizards within class library projects. Much cleaner, much simpler.

7 comments:

Anonymous said...

I'm not sure how I missed the book, but I can't wait to check it out. I agree about the web project mess. It adds to the complexity and the default behavior of vs.net just doesn't "feel" right to me.

Jim Holmes said...

>> I'm not sure how I missed the book <<

I cheated: the book's so hot off the press my fingers blistered. :)

The web project stuff really chaps my @ss because it's painful to deal with using NAnt. Actually, it just plain sucks.

Anonymous said...

Fritz's trick is cool, but I've had issues when running the project in debugger. Frtiz and I exchanged a couple emails about it, but I still couldn't get debugging to work correctly. Your mileage may vary (and hopefully it does).

Bill Evanson said...

I picked up a copy of Marc Holmes' book at Tech Ed this year in Orlando, and I agree it's been a very helpful book, but I disagree with the concept of a class library substition instead of a web app. Yes VS moves the location of the web project under your default web root instead of under the solution root, however, that's easily overcome by creating a virtual directory under the solution root before you create the web project and then creating the web project at that location. Actually that's the method Microsoft recommends if you're using VSS. Using this method I've had no problems using nant with vss in my build environment.
The "psuedo" web project recommended in the book seems short sighted to me in light of all the changes comming in v2.0
Thanks for your post about the buildnumber.version file, that one had been driving me nuts!

Jim Holmes said...

Bill, thanks for the feedback!

I'm not sure it was shortsighted for Fritz to come up with the workaround and Marc to point it out. Sure, things are changing in VS2005, but this workaround's been out for awhile to give folks a different option for the current version.

Still, I'm glad you posted your method. I like hearing from folks who are using NAnt!

I'm glad you found the buildnumber post helpful. Pretty good headslapper moment when Marc pointed out the difference in NAnt releases!

Anonymous said...

Hi Jim,

I personally find the class library thing useful so that's why it was included. I like to be able to choose the behaviours instead of requiring virtual directories.
As identified, there are a bunch of ways to work around the 'problem' presented by VS.Net and I suppose the answer is to use whichever suits.
IIRC, at the time of writing the book, this was broadly the way it was believed that Net 2 would be going in terms of its solution behaviours.

Funnily enough, Fritz is at my office next week running training for my dev team, so I'll pick up this thread with him then and see where we go. It's probably a moot point though.

Apologies for simply not being able to keep up with releases owing to publishing deadlines and so on. I had hoped to avoid too many issues such as the buildnumber.version and must have missed this. I spoke to Gert on a couple of occasions about final 0.85 release but had to go to press before.

Thanks for the slashdot review Jim. I'm sure it's a mixed blessing ;)

Jim Holmes said...

Marc,

Readers shouldn't expect authors to keep up with everything in a rapidly moving environment. Like you said, you had deadlines and most folks understand that.

I didn't do your book justice on Slashdot, I'm afraid. My first Slashdot review of another book got bounced back with requests for more details and length. As a result, my review of your book came across as a regurgitation of the table of contents, rather than the enthusiastic endorsement which it should have been. Sorry.

Terrific book, regardless of software version issues -- and I think most readers understand those difficulties.

Subscribe (RSS)

The Leadership Journey