Visual Studio Web Deployment Projects

So nearly a year and a half ago, a Microsoft team released a Visual Studio 2005 add-on that would add the "Web Deployment" project type to your IDE.  A few of the advantages of this new project type are:

  • More control over the number of assemblies generated by a pre-compiled web project, as well as control over their naming.
  • The ability to utilize the full power of MSBuild to customize your build process, including support for opening and editing the web deployment MSBuild project file directly in the IDE (with full intellisense support).
  • The ability to define and use custom build-configurations inside Visual Studio, and define per-build configuration options (for example, you could define custom build configurations like “staging” in addition to the standard "debug" and "release").
  • The ability to customize and modify a web application’s web.config file at deployment according to build configuration ("debug", "staging", "release", etc.).

Here is a link that discusses it further and gives a screenshot walkthrough of it:  http://weblogs.asp.net/scottgu/archive/2005/11/06/429723.aspx

Well, now that same team has included an enhanced version for VS 2008.  Here is a link discussing the improvements and additions:  http://weblogs.asp.net/scottgu/archive/2008/01/28/vs-2008-web-deployment-project-support-released.aspx

Also, the IIS team at Microsoft has a new command-line utility called MSDeploy that helps with deploying and syncing web projects across all of the servers in your server farm:  http://blogs.iis.net/msdeploy/archive/2008/01/22/welcome-to-the-web-deployment-team-blog.aspx

Sounds like fun to me.

Windows Vista Virtual Store

Vista has a security "feature" that locks down certain system folders (for instance Program Files) from programmatic modifications.  However, it doesn’t just deny your IO requests; instead it may or may not redirect it to some virtual store elsewhere on the file system (it’s per-user too, so that could further screw your code up if you were writing out something global or machine-wide).  The best part is you don’t know if you were redirected or not.  I’ve had it where I was being redirected to the virtualized location for writes and then when I attempted to read later, it wouldn’t redirect me and I would be reading from the real Program Files.  Another odd thing is that it appeared to always read and write from the real Program Files location if the context was that of a locally-hosted web site.

Here’s another blogger’s discovery of it for further information:  http://www.hanselman.com/blog/VistasShowCompatibilityFilesAndTheScrumptiousWonderThatIsFileVirtualization.aspx

I don’t know why I didn’t know anything about this until now, but I quickly learned about .NET’s Isolated Storage APIs.  Pretty useful for persisting configurations and such.  It was the solution to my problem in this case.  Here is a good article on it:  http://www.developer.com/net/net/article.php/3430541

I will warn you though that you should try to do the reading and writing from the same assembly from within the same application; otherwise, you end up getting different isolated storage stores for each call.  According to the many documents I read there is a way to call into a certain store even if .NET doesn’t normally map your assembly and/or application to that location (you have to provide something called Evidence).  I couldn’t get it to work and was running short on time.

Ever Accidentally Kicked Off a Build in Vs?

If you’ve ever kicked off a way long build on accident in Visual Studio, I’m sure you’ve considered doing an End Task on it (or perhaps something far more drastic and rash).  Well, there is a keyboard shortcut that will cancel the current build in progress.  Just hit Ctrl+Break, and hand me the sledgehammer before you do something you regret.  Computers are your friend.  Repeat after me…

Some Pending Microsoft Technologies

A cool new technology Microsoft is working on in its Live Labs is called Volta.  It is a way to develop web applications all in one tier, and then late in the development process decide which parts of the code should be client-side and which parts should be server side.  The idea is that you can easily move code fragments back and forth between client-side and server-side at will.  You write your web application in any language of your choice that compiles to .NET and Volta will turn it completely and solely into HTML and JavaScript, meaning your resulting site will be compatible with any browser.  And your site can have all of this with an AJAX look-and-feel.  Check it out here:  http://labs.live.com/volta/

A different Microsoft team is working on a download called ASP.NET 3.5 Extensions (http://www.asp.net/downloads/3.5-extensions/).  It is in "public preview" right now.  It contains some new additions to ASP.NET AJAX, some new Silverlight controls, and a few other cool additions.  Most interesting to me is an MVC Framework  (Model-View-Controller).  One of the managers has a blog that I frequent, and he has written a 5-part series of blogs about this new framework.  This link will send you directly to Part 1 (skipping Part 0):  http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx

Also, it appears Microsoft recently released a training kit for Visual Studio 2008 and .NET Framework 3.5 available for download now at the following location:  http://www.microsoft.com/downloads/details.aspx?FamilyID=8bdaa836-0bba-4393-94db-6c3c4a0c98a1&DisplayLang=en

Enjoy.