Fervent Coder

Coding Towards Utopia...by Rob Reynolds
posts - 278 , comments - 431 , trackbacks - 0

My Links


Rob Reynolds

Subscribe to Fervent Coder RSS
Subscribe to Fervent Coder by Email

About Me

I manage several open source projects. Need...
   ...package management for Windows?
   ...automated builds?
   ...database change management (migrations)?
   ...your application to check email?
   ...a monitoring utility?

I also write for

Like what you are reading? Want to buy me a cup of coffee?
PayPal - The safer, easier way to pay online!


Post Categories

Image Galleries


Published Applications AKA _PublishedApplications

Less maintenance. Less work to package during your automated builds. Too easy.


_PublishedWebsitesRemember 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.

Nice package!

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.

Introducing _PublishedApplications

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.

MSBuild Import

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

NuGet Package Manager Console

Install-Package PublishedApplications

Want A Demonstration?

Why talk when we can just look at a short video that demonstrates this idea?

Install-Package PublishedApplications

Special thanks to David Keaveny for this great idea!

Print | posted on Monday, March 21, 2011 12:22 AM | Filed Under [ Code ApplicationsToysOther UppercuT ]


Comments are closed.
Comments have been closed on this topic.

Powered by: