Less maintenance. Less work to package during your automated builds. Too easy.
Remember Our Old Friend _PublishedWebsites?
You’ve probably seen the _PublishedWebsites folder when building websites in automated builds. If not you can stop paying attention now.
Still with me? Great! So you know how it packages up everything nicely with content files going where they should with nearly ZERO cost to your build scripts. All you need to do is override the output directory (OutDir) and you get this feature. This behavior is arguably one of the best things that web projects do during automated builds.
So how many of you, like me, just accepted the fact that this was just for web, and not other applications, and went on maintaining your build scripts to package up your other application types? Yeah, me too. Painful…and we looked at complicated ways of solving this problem. There has to be a better way.
Recently David Keaveny came up with an idea to take the Microsoft.Web.targets file (which produces the _PublishedWebsites folder – it is imported by the csproj/vbproj file), change up a couple of variables and rename it to the Microsoft.Application.targets file. When I saw this I thought this was an awesome idea! How come I didn’t think of that? Why didn’t anyone else see the simple solution?
The concept is simple – You add the .targets file to your application. Then you edit the csproj/vbproj file by hand to add in the import for the .targets file.
And you get a nice folder with your application bits nicely packaged for you.
Note: The _PublishedApplications folder ONLY shows up when you override the output directory during an automated build or command line access to building a solution. The rest of the time your builds go to their normal folders (i.e. bin\Debug).
PublishedApplications Is On NuGet
I loved this idea so much I did the work to figure out how to automate the imports part of the idea so it was a simple command to use Microsoft.Application.targets. And this is on NuGet: http://nuget.org/list/packages/publishedapplications
Want A Demonstration?
Why talk when we can just look at a short video that demonstrates this idea?
Special thanks to David Keaveny for this great idea!
Recently we had a contest to see who could beat my time to get from no code to deployed. Thanks to everyone that participated and everyone that thought about participating in the contest.
Most Creative From Zero To Deployed Contest Extended!
Unfortunately there were not enough entries to award the most creative video for ZtD. So what we are doing is extending the most creative until May 15, 2011 @ 11:59 PM CST. This gives you almost two months to get your videos in! If you entered before, you are allowed to re-enter for the most creative (even if you won the first contest).There is no minimum number of entries this time around either. Refresh yourself of the rules/prizes from the last post and get coding!
And The Winner Is…
I want to thank those that participated. It takes a lot to code against the clock, and even more to capture it on video and put it up for the world to see. Those two factors alone helped me realize I wouldn’t get a lot of entries and I’m excited that at least two people jumped in with submissions! Cool points to all participants.
As long as the rules were followed, the person with the best time would win. And that person would win $2348 worth of prizes! To recap the prizes:
- $50 Gift Card (provided by me)
- $100 service credit for AppHarbor (provided by AppHarbor)
- Full personal license of ReSharper (provided by Jet Brains)
- Telerik Ultimate Collection for .NET (provided by Telerik)
And the winner is James Pogran with a time of 5:50! Congratulations man! Be sure to give him a shout out on twitter!