Creating “Dynamic” XSL Variables


One of the really ugly things about working with Xsl is that it doesn’t support actual variables. There is a ‘variable’ element but it isn’t actually a variable; it is a constant as the value cannot be changed once it has been set. This leads to all sorts of horrible solutions, like duplicating Xsl for the various possible values/conditions or even turning a block of Xsl into a template and then passing parameters to it every time that value is needed. The latter works and is supported but is frequently overkill.

However, there is another way Click to read the full post

PowerShell Syntax Highlighting script


As a SharePoint administrator, I end up either writing a lot of PowerShell scripts or copying existing scripts and modifying them to fit a new need.  With all of these scripts comes the need to share them with other admins outside of the command line and in such a way that allows them to be easily Click to read the full post

Easily Allow Content Authors To Open Links as Dialogs


SharePoint 2010 introduces the new Dialog functionality that allows users to easily edit and update items from links on a page without having to leave that page; this works well and has a nice user experience.  The dialog functionality is primarily intended for use when editing list items or document properties, but I have had numerous requests to open other content (like news items) in dialogs as well.  This is relatively simple to do through JavaScript but does require a developer to be involved for each request, which is often time-consuming and expensive.  Ideally, there should be a way for the Content Authors themselves to specify which links open as dialogs and which do not.  Click to read the full post

Conditional Library References in Visual Studio


I recently ran into a situation where I needed to have a single project in Visual Studio build the application two different ways with each way using different DLL references. The normal Project Properties provide all sorts of mechanisms for build-specific options but Microsoft seems to have left the ability to specify conditional library references out of it for some reason.

It turns out that while they did leave it out of Visual Studio, it is available in MSBuild which Visual Studio uses to actually compile the code.

Here is how it works: Click to read the full post

Automatically Set the AssemblyFileVersion for Visual Studio Projects


One of the more annoying quirks with dealing with SharePoint is that once you develop a solution that requires custom code, all dependencies are then tied to the Strong Name of the compiled DLL.  That strong name also includes the version number, usually 1.0.0.0, and cannot be changed without breaking all existing references.  This is a good thing from a compatibility perspective but it does make it rather complicated to figure out exactly which version of a DLL is in use.

You can open up the WSP and then use the timestamps and take a guess at the version but it is not always reliable.  Click to read the full post