Recently I had to write some code that got the value of the scheduling frequency in Sitecore config. Normally, to get a value from Sitecore config, I’d simply use:
However, in this case, the value that I want is not in the <settings> node and the above code won’t work. The value I want is in the <scheduling> node:
<!-- SCHEDULING --> <scheduling> <!-- Time between checking for scheduled tasks waiting to execute --> <frequency>00:05:00</frequency>
To get around this, instead, I used:
The above code should work for any Sitecore config item just by specifying the correct Xpath location for the value you require.