Sunday, 16 June 2013

Token Replacement in Visual Studio

I was working on a simple WCF service, including a generic handler (.ashx). My code looked good until I tried to access the url - it started complaining that it did not know what '$SharePoint.Project.AssemblyFullName$' was.

A little digging ( here and here ) revealed at VS will not replace its tokens in all file types - you may need to specify them in the project file. Generic handlers are one of those types.

So, first I unloaded the project and added the following to the property group:

<PropertyGroup>
 <TokenReplacementFileExtensions>ashx</TokenReplacementFileExtensions>
</PropertyGroup>

I then reloaded the project and redeployed. Too easy.


No comments:

Post a Comment