A MSBuild convention proposal - Targets per assembly

MSBuild.aspx) is a very powerful build tool. Unfortunately, in my experience, I have seen it utilized very little. Instead, developers rely entirely on Visual Studio for the build, which is a mistake. I think there are a couple reasons for this: Modifying the build feels like you are mucking in the internals of Visual Studio There is no convention based approaches for how to handle custom bulid targets Now, you could go the way of NAnt, and have complete independence from Visual Studio. »

MSBuild performance tips

A while back, I posted about a Powershell script I wrote to help analyze build performance. Today I spent a good amount of time looking at the output and tweaking things. I came across a couple BIG performance enhancements that I thought I would share. Tip #1 - Don’t start external processes Starting another process is a time consuming activity, and if you are doing it on a post/pre build event, that is going to slow your build down tremendously. »

Brian Hartsock on #MSBuild,

Analyzing Visual Studio Build Performance

Every now and again, your build time gets so long you have to investigate what the cause is. Since Visual Studio uses MSBuild, it is possible to get very detailed build information. The first step is getting into diagnostic mode. This will print out way too much information, but it is the only mode that prints out execution summaries for each project. To get into diagnostics mode, simply go to Tools -> Options -> Projects and Solutions -> Build and Run. »

Using Powershell scripts from MSBuild, Scheduled Tasks, etc.

There are a few different ways to use Powershell from the legacy cmd shell. The most common way is to call it like the following. > powershell write-host "hello world" As you can see, the powershell.exe is called with Powershell commands as the parameters. I started noticing some odd behavior though. I have the following script, TestScript.ps1. It has code as follows: param ( $str ) write-host $str Very simple right. »

New Home - Mosso and Cloud Files

Yesterday, I took the plunge, changed my DNS, and am now on Mosso. Dreamhost was getting slow, and having intermittent outages, so I needed the switch. Not to mention Mosso is another division of Rackspace, just like Mailtrust. I am super happy with Mosso so far. The blog is faster than ever, and I have had almost no problems. What’s even crazier is I am using CDN Tools to host a lot of my static content on the Cloud Files CDN. »

sqlcmd.exe and MsBuild

Today I wrote my first MsBuild script that uses sqlcmd.exe to execute SQL Server commands remotely. It is awesome. Although it is fairly limited, for tasks like backing up databases, it is very simple and easy. <target name="Backup"> <exec command="sqlcmd -S $(server) -q "$(sql)""></exec> </target> »