Search code examples
visual-studio-2010asp.net-mvc-2msbuild

Run web.config transformation from command-line


Good day!

I want to have ability to build ASP.NET MVC 2 project using VS2010 Publish dialog and from command-line.

For command-line I get the following to work:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe .\SolutionFolder\MyProject.csproj /p:Configuration=Release;DeployOnBuild=True;PackageAsSingleFile=False;outdir=c:\_OutputFolder\

The only problem I have that Web.config transformation are not applied (but added to WebDeploy package). I don't use WebDeploy. Is there any way to apply Web.config transformations?

Thanks!


Solution

  • You can also try using the XDT Transformation Tool:

    http://ctt.codeplex.com was moved to Github https://github.com/greenfinch/ctt

    I'm using this instead of messing with obscure msbuild targets.