In my Nant file I've got (paths shortened):
<echo message="#### TARGET - compile ####"/>
<echo message=""/>
<echo message="Build Directory is ${build.dir}" />
<exec program="${framework}\msbuild.exe"
commandline="..\src\Solution.sln /m /t:Clean /p:Configuration=Release" />
<exec program="${framework}\msbuild.exe"
commandline="..\src\Solution.sln /m /t:Rebuild /p:Configuration=Release" />
<exec program="${framework}\msbuild.exe"
commandline="..\src\Solution.sln /m /t:TransformWebConfig /p:Configuration=Release" />
Which results in:
Build FAILED. "C:\..\src\Solution.sln" (TransformWebConfig target) (1) -> C:\..\src\Solution.sln.metaproj : error MSB4057: The target "TransformWebConfig" does not exist in the project. [C:\..\src\Solution.sln] 0 Warning(s) 1 Error(s)Time Elapsed 00:00:00.05
The solution and associated projects are all VS2010 and the Web Application even has the correct reference in the .csproj:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
Shouldn't this just work?