How to get VS2010 Web.config Transformations working from NAnt?

Posted by jmcd on Stack Overflow See other posts from Stack Overflow or by jmcd
Published on 2010-06-09T16:49:02Z Indexed on 2010/06/09 16:52 UTC
Read the original article Hit count: 581

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about visual-studio-2010

Related posts about msbuild