The final step is to tell MSBuild to replace tokens in .asmx files. You can do that for a specific project or for all projects you build on that machine.

Replacing Tokens for a Specific Project

To let MSBuild replace tokens for a specific project add a TokenReplacementFileExtensions element to your .csproj file like shown below. To which PropertyGroup element you add it doesn’t matter – it just has to be added before the Import elements.

Replacing Tokens for All Projects

To let MSBuild replace tokens for all projects edit C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets – be shure to make a backup copy first. Open the editor as administrator and in the file extend the TokenReplacementFileExtensions element by adding “;asmx” like shown below.