In Visual Studio 2012 Update 2 there's a sweet little new gem, that I championed for some time in the past, and that has finally made it into the VS box: You can now publish individual files to the server without having to publish the entire site. You can now publish 1 or more files simply by selecting them in the Solution Explorer and using the Context Menu's Publish Selected Files or Publish File xxxx.xxx.
In the past if you wanted to publish your site, it was an all or nothing affair: You basically had to rebuild and re-publish the entire site. Publishing works great when you're making major updates that affect binaries and configuration settings. In that case you do want a full publish to push up your binary file changes as well as web.config transformations etc. This is a great feature and the cornerstone of publishing which is as it should be.
But on more than a few occasions I've:
- Forgotten to include some content file like an image in a full publish
- Had to make a really minor change to a content file or image and need to push it up
- Make some quick iterative changes repeatedly to a file to tweak the UI or an image on the server
Now, with Update 2 you have another option to publishing the entire site -you can now publish an individual file.
I know this is a minor thing, but I can't tell you how often I use this for quick image or CSS updates. Sometimes I actually prefer making changes to these sorts of things on a live site rather than firing up the local copy first especially if the live site is running with a full set of data. It's often convenient to just push individual files. This is especially true for my personal content sites, more so than typical business applications.
Web Deploy Getting Easier
As a side note I've been a big fan of Web Deployment in Visual Studio - it's such a tremendous time saver over manually uploading files to the server and trying to figure out what needs updating. Prior to Web Deploy features in Visual Studio I actually had used a custom solution I cobbled together using FTP that provided much of the same functinality including the abililty to push individual files which I found very useful.
It's also great in a team environment, since publish settings are typically shared in source control. This ensures that everybody is pushing up code consistently to the staging or live server using the same settings that are configured only once. It's great when a new developer comes on board especially - they don't have to configure anything they are just ready to go.
When Web Publishing was introduced the intial versions were horrible to the point of unusability. In VS 2010 it improved somewhat, but the server side installation of Web Deploy was still a major pain in the ass. Getting Web Deploy configured properly on the server has been a real pain in the ass with 3 different installs required and several manual configuration steps.
With the latest Web Deploy 3.0 release though, Microsoft finally seems to have gotten Web Deploy right to where it's a single simple installation on the server that just works once installed. There no longer are any finicky configuration settings and it just works off the single install. Inside of the Visual Studio 2012 Web Publish client also has made the Publish Settings dialog a bit more user friendly and more flexible in what you can use to connect to the server. VS now understands pure site urls and virtuals as opposed to the base site url and Site ID/Name that was required previously and was always confusing.
The end effect is I no longer dread setting up Web Deploy for the first time on a server, nor do I have to go look up the configuration for another site to figure out what put in the boxes :-).
It's kind of sad that it took so long for Web Deploy to get it all right, but now the whole thing is ridiculously smooth. There are a still a few issues with web.config transforms that are difficult to deal with from time to time, but that's not really Web Deploy's problem, but a problem of how to partition developer specific settings in configuration files which is always a problem.
In any case, I hope some of you find the new single file or selected file publishing feature as useful as I have. It's just one more little tweak that makes life easier and shaves a few minutes off the development process. Score!
Other Posts you might also like