It doesn\'t seem to be possible to change the Build Configuration of Visual Studio 2010 Website Projects (as opposed to Visual Studio Web Applications), and changing the Bui
I'd prefer not to use entire an Web Application Project solution out of box. My solution is to use the XmlTransform task defined in Microsoft.Web.Publishing.Tasks.dll directly (this task is the core of WebConfigTransformation) This way it is flexible enough and does exactly what you expect it to do. For example here is the WebSiteTransformator.csproj I'm using for transforming web.config.
Here also is an example of flexibility that is impossible to reach with original WebConfigTransformation: it takes web.Template.config, applies web.$(Configuration).config over it and writes web.config. This allows us to add web.config itself into ignore list in source control. It is still valid csproj to be referenced by website:
AnyCPU
2.0
Library
v4.0
$(TEMP)\TransformWebConfig\bin
$(TEMP)\TransformWebConfig\obj\
$(BaseIntermediateOutputPath)$(Configuration)\
$(SolutionDir)\MyWebSite\