Published Applications AKA _PublishedApplications

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.

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:

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!

Posted 03-22-2011 9:23 PM by Rob Reynolds
Filed under: , , ,



Jan Van Ryswyck wrote re: Published Applications AKA _PublishedApplications
on 03-23-2011 2:40 AM

Until this very day, the Microsoft.Web target has still a big issue with secondary references:

This is something I run into frequently.

mick wrote re: Published Applications AKA _PublishedApplications
on 03-24-2011 3:32 PM

what about web config transforms? is it possible to run those also with say an app.config + app.config.debug etc

Rob Reynolds wrote re: Published Applications AKA _PublishedApplications
on 03-24-2011 3:41 PM

@mick: I didn't try it. It may work out of the box...give it a try and let me know.

Darrell Mozingo wrote re: Published Applications AKA _PublishedApplications
on 09-27-2011 10:44 PM

Dude, this is awesome! Nice work!

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Google Reader or Homepage Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of
Red-Gate Tools For SQL and .NET


SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
NHibernate Profiler
Balsamiq Mockups
JetBrains - ReSharper
Web Sequence Diagrams
Ducksboard<-- NEW Friend!


Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers


Community Server (Commercial Edition)