Quantcast
Channel: MSBuildExtensionPack Discussions Rss Feed
Viewing all articles
Browse latest Browse all 468

New Post: XmlFile

$
0
0

Hi

You need to specify the namespace. You also have a case issue with your attribute filter value. It's a capital F in workFlow.

 

<Project ToolsVersion="4.0" DefaultTargets="DefaultWithNameSpace" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Import Project="$(MSBuildExtensionsPath)\ExtensionPack\MSBuild.ExtensionPack.tasks"/>
    <!-- Sample XML
        <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <appSettings>
    <add key="workFlow" value="XYZ" />
  </appSettings>
</configuration>
    -->
    <PropertyGroup>
        <WorkflowConfigPath>Mikes</WorkflowConfigPath>
    </PropertyGroup>
    <ItemGroup>
        <Namespaces Include="Mynamespace">
            <Prefix>x</Prefix>
            <Uri>http://schemas.microsoft.com/.NetConfiguration/v2.0</Uri>
        </Namespaces>
    </ItemGroup>
    <Target Name="DefaultWithNameSpace">
        <MSBuild.ExtensionPack.Xml.XmlFile Namespaces="@(Namespaces)"
                                            TaskAction="UpdateAttribute"
                                            File="temp.xml"
                                            XPath="/x:configuration/x:appSettings/x:add[@key='workFlow']"
                                            Key="value"
                                            Value="$(WorkflowConfigPath)"/>
    </Target>
</Project>

 

Mike


Viewing all articles
Browse latest Browse all 468

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>