SMS Task for NAnt using BT SDK
What:
A simple NAnt custom task to send SMS messages using the BT SDK.
Why:
Maybe you want to ping your manager every time the build fails :).
How:
1. Setup the SDK on your PC using my tutorial here. Please note that you need to register your own certificate and generate a wse3policyCache.config file which will be used in the next step.
2. Copy the SMS.Tasks.dll, btsdk.dll, btsdkcomponents.dll, wse3policyCache.config in your Nant/bin directory.
3. Change the Nant.exe.config to include the following entries so that it can pick up WSE config file. I suggest making a backup of that file before doing any changes.
--a) This goes in <configSections> tag.
<section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
--b) And this can be anywhere inside <configuration> tag.
<microsoft.web.services3>
<security>
<x509 storeLocation="CurrentUser" />
</security>
<policy fileName="wse3policyCache.config" />
<diagnostics>
<trace enabled="false"/>
</diagnostics>
</microsoft.web.services3>
I have provided a sample Nant file in case you need to refer to it. Please do not just replace your existing file with this as it will overwrite any existing configuration.
4. Sample usage:
<target name="smstask">
<echo message="Before executing task" />
<sms to="phone.number" message="Build Failure" />
<echo message="After executing task" />
</target>
Where: