Atmel Studio 7 Custom Build Tool Output
Well after much head scratching, I've finally tracked down where the issue is. Basically it is because avrdude uses STDERR for all of its verbose output rather than STDOUT. Visual studio in the output window is as a result treating every line it outputs as an error.

To solve the problem requires that the output from avrdude be redirected from STDERR to STDOUT so that it can be shown in the output window without causing an error. The typical approach to this is simply to append 2&gt;&amp;1 to the end of the command, however Visual Studio is treating this as an argument to avrdude so it doesn't work.

The solution appears to be to basically wrap avrdude up in a batch file to do the redirection. I've built the following batch file:

@echo off

set solndir=%~1
set device=%~2
set hexfile=%~3
set port=%~4

if /I "%device%" == "ATMega2560" (
    set prog=wiring
    set baud=115200
) else (
    set prog=arduino
    set baud=57600
)

echo Running AVRDude With Command:
echo "%solndir%avrdude\avrdude.exe" -C"%solndir%avrdude\avrdude.conf" -p%device% -c%prog% -b%baud% -D -v -Uflash:w:"%hexfile%":i -P%port% 2&gt;&amp;1

"%solndir%avrdude\avrdude.exe" -C"%solndir%avrdude\avrdude.conf" -p%device% -c%prog% -b%baud% -D -v -Uflash:w:"%hexfile%":i -P%port% 2&gt;&amp;1


I can then set the custom programming tool command to:

$(SolutionDir)avrdude\avrdudeStdout.bat $(SolutionDir) $(avrdevice) "$(OutputDirectory)\$(OutputFileName).hex" "\\.\COM4"


The result is that avrdude is now correctly run and the output is now on STDOUT so is no longer causing error messages in Atmel Studio. In the event that avrdude fails, a non-zero exit code is still returned from the batch file and that correctly issues an error.