Visual Studio replaceable parameters for SharePoint solutions
By Phil Jirsa
December 8, 2011 —
(Page 1 of 2)
If you’ve done any development on SharePoint 2010 using Visual Studio, you’ve probably noticed some files in your project that include strings like
$SharePoint.Project.AssemblyFullName$ or $SharePoint.Package.Name$
. These token strings are called Replaceable Parameters. When your SharePoint Solution (.wsp) is being packaged by Visual Studio, the packaging tool will search for and replace these tokens with values that are not known at design time.
Some of you probably remember doing this process manually with SharePoint 2007 projects. Build the solution; copy the DLL to the GAC; view properties of assembly in the GAC and copy PublicKeyToken; finally, create the assembly full-name string by hand and paste it back into a manifest file, etc. It was time-consuming and error-prone, though some third-party tools did help with this process.
Now, we can leverage Replaceable Parameters to avoid this process and do lots more. These parameters can be useful for single developer projects all the way to large projects using TFS with automated builds.
Let’s use an example to illustrate injecting a class name for an event receiver into a feature.
First, we need to create a new project in Visual Studio. Choose the “Empty SharePoint Project” template from the list.
Next, add an
to the item to the project. I called mine EventReceiver1. For the event receiver settings, I chose list events and Document Library as my event source. To complete the wizard, choose the specific events that you’d like to implement handlers for and click
Visual Studio will now build a class to contain our handlers and a feature to provision the handler to a site. These items should now appear in Solution Explorer, and the class for our handlers will be open.
element and open the
file. This is where our feature is going to wire up the event handlers to our SharePoint environment.
Share this link:
Customizing SharePoint Online Using SharePoint Designer, Part 1
Once you get a handle on SharePoint Online, the question becomes: How can I modify it to suit my needs. First of two parts.
Visual Studio Update 2 targets SharePoint
IntelliTrace support and imprvoed load testing highlight this release
Bamboo Solutions releases Chart Plus R3.5 for SharePoint 2010
Bamboo Solutions has announced the release of Chart Plus R3.5 for SharePoint 2010
This site's content Copyright © 1999 - 2013 by BZ Media LLC, All rights reserved.
Legal and Privacy
Phone: +1 (631) 421-4158 • E-mail: