Visual Studio Token Replacement Tip – WCF


In earlier post I provided one way to enable automatic token replace when building a WCF service for SharePoint 2010 (but this tip applies for any project really), here is what I said


Setup token replacement, see

Essentially, this minimizes the need to manually add things like a 4-part assembly name. After all, the solution already has that information so why not have VS2010 do the work for you.

Navigate to Program files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\SharePointTools


Open up the Microsoft.VisualStudio.SharePoint.targets file and locate the TokenReplacementFileExtensions node.


Add svc to the list of replacement extensions



The above is ok and works for all your projects except that the file will/could be overwritten by service pack updates. Another way to handle this is to open your *.csproj file and locate the <TokenReplacementFileExtensions> element and add the svc extension directly into the project. Again, see the specifics in




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s