Friday, September 22, 2006
« Holy Cow, I'm White and Nerdy! | Main | ASP.NET Web Site Administration Tool on ... »

Ok, maybe it's just that it's 4:30 AM and I need to get to sleep, but this is something that has bugged me for sometime, and it's just coming to a head right now.

I just don't get how VS2005's Publish Web Site option is all that helpful, especially on a second time around.  Let me explain.

I really like how simple it is to 'push' a website up to a server.  Simply enable FrontPage Extensions on the web site in IIS and viola, you can publish from VS2005.  Slick.  If you're publishing for the first time, it's all smooth and it pushes the entire website (content, databases, etc) as prescribed in your project in VS.

I would argue, however, that that's usually not the last time the website is touched.  Tweaks need to be made, new logic introduced, alternative site navigations added, etc.  In short, there's maintenance.  When you go to publish a second time around it will warn you with a message indicating that "Existing files in the destination location will be deleted.  Continue?".  While appreciate the warning, I think it's completely out of line.  The warning is, in fact, telling you the truth.  When you publish, ALL files, folders, etc in your target folder will be purged.  I think this is a bad thing in several ways.

In an effort to combat this work around this egregious behavior by excluding files from your project in an attempt to not upload them; this will, in fact, work - the files will not get uploaded, but they will disappear from the server all the same.

But the one thing that's really irking me right now is how it handles databases.

Suppose you're creating a website that uses SQL Server Express and have the customary ASPNETDB.mdf in the App_Data folder to maintain membership, profiles, roles, personalization settings, etc.  There's not a convenient mechanism to publish your website from Visual Studio because doing so will effectively destroy the target database, replacing it with the one from your development environment.

So what's the deal?  Why does it a) not give the option to skip the uploading of databases b) have to delete every stinkin' file?