I have set up my build on Visual Studio Team Services but looks like that the Web.config transformation of my Web.Release.config doesn't work and I receive only the standard Web.config. What I do wrong or what parameter I miss.
2 Answers
For the transformation to happen msbuild needs to "deploy" the solution. I am not sure of the most correct way to do it, but a easy workaround would be add
/p:DeployOnBuild=true /p:PublishProfile=SomeProfile to the MSBuild Arguments option. You can then grab the files from wherever you configured the publish profile to put them and use those during your deployment.
Here is a very simple example of a SomeProfile.pubxml file that would put the published files in the artifact staging directory.
<?xml version="1.0" encoding="utf-8"?> <!-- This file is used by the publish/package process of your Web project. You can customize the behavior of this process by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121. --> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <WebPublishMethod>FileSystem</WebPublishMethod> <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> <LastUsedPlatform>Any CPU</LastUsedPlatform> <SiteUrlToLaunchAfterPublish /> <LaunchSiteAfterPublish>False</LaunchSiteAfterPublish> <ExcludeApp_Data>False</ExcludeApp_Data> <publishUrl>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\Release</publishUrl> <DeleteExistingFiles>False</DeleteExistingFiles> </PropertyGroup> </Project> Using the MSBuild command args in TFS
/p:DeployOnBuild=true /p:PublishProfile=SomeProfile dropping the /p:outDir.
4 Comments
$(BuildArtifactStagingDirectory)\Release and get rid of the /p:outDir in your build step. Profiles are just MSBuild scripts themselves and should be able to use the global variables.The profile want work for me on the build server. I found this solution that works for me.
/p:outdir=$(build.artifactstagingdirectory)\Release /p:UseWPP_CopyWebApplication=true /p:PipelineDependsOnBuild=false This part makes the difference:
/p:UseWPP_CopyWebApplication=true 
Deploythe config that is created when you just do aBuildis the untransformed version.