I am using MSBuild and MSBuild Community Tasks (using XMLUpdate and XMLMassUpdate) to update various sections of my Web.config one thing has me stumped though. If I have:
The first problem is the xpath is incorrect for updating the attribute, it is currently looking for "target" nodes with an attribute called "fileName" rather than the "fileName" attribute of the a node called "target".
The xpath you want is: /configuration/nlog/targets/target/@fileName
As for the namespace issue, Preet Sangha has the correct answer for that, you need to use the namespace prefix, and this must be applied to every sub-element as well, since they are all in that namespace.
The final statement being: