1

Closed

XmlFile.SetValue Returns Error "Could not find resource string NodeType 'Attribute' is not suported for this Task"

description

Hello,
 
When I use the following:
 
<XmlFile.SetValue
Path="$(ConfigFile)"
XPath="/configuration/appSettings/add[@key='blah']/@value"
Value="myVal"
IgnoreNoMatchFailure="false"
Force="true" />
 
I receive the message:
Could not find resource string NodeType 'Attribute' is not suported for this Task.
TFSBuild.proj(443,5): error : at Microsoft.Sdc.Tasks.XmlFile.BaseXmlFileTask.SelectXmlNodesOfType(XmlNode doc, String xpathExpression, XmlNodeType nodeType, XmlNamespaceManager nsMgr) in c:\projects\codeplex\sdctasks\Solutions\Main\Tasks\XmlFile\BaseXmlFileTask.cs:line 161
TFSBuild.proj(443,5): error : at Microsoft.Sdc.Tasks.XmlFile.SetValue.InternalExecute() in c:\projects\codeplex\sdctasks\Solutions\Main\Tasks\XmlFile\SetValue.cs:line 100
TFSBuild.proj(443,5): error : at Microsoft.Sdc.Tasks.TaskBase.Execute() in c:\projects\codeplex\sdctasks\Solutions\Main\Tasks\TaskBase.cs:line 66
 
Any suggestions would be much appreciated.
Closed Aug 26, 2010 at 9:38 PM by mikeFourie
This library is no longer under active development / support. Please see the home page for details.

comments

mikeFourie wrote Sep 24, 2009 at 9:57 AM

That task will never work for setting attribute values due to a bug in it. You can use this rather
    <XmlFile.SetAttribute Path="$(ConfigFile)" XPath="/configuration/appSettings/add[@key='blah']" Name="value" Value="myVal" IgnoreNoMatchFailure="false" Force="true" />

wrote Aug 26, 2010 at 9:38 PM

wrote Feb 14, 2013 at 2:32 AM

wrote May 16, 2013 at 7:00 AM